Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent width / height in FScreen when resizing window in Unity Editor #205

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

jpsarda
Copy link
Contributor

@jpsarda jpsarda commented Oct 10, 2013

When testing in free aspect window in Unity editor, if you resize the window, the width and height are no longer valid as soon as the screen orientation is not the same as the initial orientation.

You can test with the Banana demo, if you start in landscape mode and resize to portrait mode, the game is no longer adapted to the screen size as it has wrong width and height returned by Futile.screen.

I'm aware this is not a critical issue as it only happens in the Editor (unless you can resize dynamically the web player too?), but this modification is handy to check orientation change in real time in the Unity Editor (as long as you test (Futile.screen.width<Futile.screen.height) to decide is your layout is in portrait mode).

@MattRix
Copy link
Owner

MattRix commented Oct 22, 2013

Hmm yeah I'll have to think about this... so if I'm reading this right, if the width becomes shorter than the height, then it kinda switches them and it fires an orientation change event, as if it had changed from landscape to portrait? That does make some sense, but I wonder if it might confuse people?

@jpsarda
Copy link
Contributor Author

jpsarda commented Oct 22, 2013

The fix doesn't send the orientation change event as I was not sure if it's something reserved for an actual orientation change in a true device. But yes that's the idea.

@jpsarda
Copy link
Contributor Author

jpsarda commented Oct 31, 2013

Just to let you know that after testing it on the device, this pull request doesn't work well. So I switched back to your version. But as you might know as I already posted on reddit, FScreen needs to be improved a bit as when the device is changing its orientation there's a dirty on frame transition screen, and HandleResize being called twice.(tested on ipad mini)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants