You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenFL/Lime or NME version: OpenFL 8.4.1 Lime 6.4.0
I'm trying to scale my game based on the resolution of the device it's running on, and based on the ScreenScale demo, it looks like I want to do something like this:
HXP.screen.scaleMode = new haxepunk.screen.ScaleMode();
HXP.screen.scaleMode.setBaseSize(800, 600);
HXP.resize(HXP.screen.width, HXP.screen.height);
However, the end result is not what I would have expected. The non-scaled version looks like this:
But the scaled version appears like this (scaled to 1200x900):
Also notice the mouse position shown in the console. In both screenshots the mouse is in the top left corner, but when the game is scaled everything seems to be offset by at least 100 pixels vertically and horizontally.
I've tried various ScreenScaleModes but to no effect. Am I missing something obvious or is this broken? Until somewhat recently HaxePunk allowed accessing the stage object so I scaled apps using that; this is the first time I've had to use HXP.resize().
The text was updated successfully, but these errors were encountered:
What devices are you trying this on? Are you expecting the size of the window to change?
Take a look into this if you can and tell me if this allows you to achieve what you're looking for:
NME: nme.Lib.stage.resize( WIDTH, HEIGHT );
I'm not sure about openFL. It seems that if Lime is in the target then the OpenFL window class inherits from the Lime window. So when you get the current window you can do something like this
I'm trying to scale my game based on the resolution of the device it's running on, and based on the ScreenScale demo, it looks like I want to do something like this:
However, the end result is not what I would have expected. The non-scaled version looks like this:
But the scaled version appears like this (scaled to 1200x900):
Also notice the mouse position shown in the console. In both screenshots the mouse is in the top left corner, but when the game is scaled everything seems to be offset by at least 100 pixels vertically and horizontally.
I've tried various ScreenScaleModes but to no effect. Am I missing something obvious or is this broken? Until somewhat recently HaxePunk allowed accessing the stage object so I scaled apps using that; this is the first time I've had to use HXP.resize().
The text was updated successfully, but these errors were encountered: