I’ve built “DysplayingABitmap” sample for Android and have a problem with device orientation: after I change orientation – only half of the screen is present.
The problem is reproduced on two different devices (Android 5.0, Android 6.0). Does it normal behavior for just built sample applications? How can I manage orientation to make it “normal”?
P.S. I’m not sure that it helps, but when I hide application (not close) then open it from recent applications (android’s navigation square button) the problem disappeared.
I’ve removed OpenFL and install new OpenFL 8.1.1 and Lime 6.3.1, also I’ve deleted project’s export folder, reexported project to Android by “openfl build android”, uninstalled the application from the device, cleared Android Studio caches, but the problem is still reproduced
Hello, just in case here is my configuration for today:
macOS Sierra
OpenFL Command-Line Tools (8.1.1-LVPK6O)
…
MacBook-Pro-Kleon:PiratePig valera$ lime
Lime Command-Line Tools (6.3.1)
…
MacBook-Pro-Kleon:PiratePig valera$ openfl setup
lime is up to date
hxcpp is up to date
lime-samples is up to date
openfl-samples is up to date
actuate is up to date
box2d is up to date
layout is up to date
I’ve found that SDLActivity.setOrientation method doesn’t run after I change device’s orientation. Should it be called every time when screen orientation changed?
Also I’ve noticed that SDLActivity.setRequestedOrientation always is -1 and it called only one time when application is running
Here is SDLActivity log:
05-29 13:02:47.526 24687-24704/org.openfl.samples.piratepig V/SDL: Running main function hxcpp_main from library libApplicationMain.so
nativeRunMain()
05-29 13:02:47.571 24687-24687/org.openfl.samples.piratepig V/SDL: onWindowFocusChanged(): true
05-29 13:02:47.601 24687-24704/org.openfl.samples.piratepig V/SDL: setOrientation() orientation=-1 width=1080 height=1920 resizable=true hint=
Okay! Reproduced the regression, and it is fixed. We needed to mark the rendering as dirty when the screen was resized – that was the cause of the objects being rendered in the wrong place. The second is that we stop rendering when the screen is not dirty, but this was causing an issue during the rotation. For now, I’ve added code to force rendering for a time after rotating, which is fixing the issue, but hopefully in the future we’ll have something a little cleaner.
This will go out in the next release, sorry for the regression, and thank you for your help! This wasn’t showing up for most content which A.) renders every frame and/or B.) has a locked orientation to portrait or landscape.
Yes bug seen on android-phones, ios works good. When rotate phone - half screen and bad position.
HTML5 target, Chrome browser. (latest openfl and lime)
The latest changes in the repo should help, the key is the __setTransformDirty() call when the window is resized. You can also call stage.invalidate () yourself every frame, or when a resize occurs, and it might do it, too