Hi, I’ve been trying to scale my game based on the size of the window, and I found this good post which seemed like it would work. Unfortunately, the screen doesn’t actually scale at all. I’m using lime 6.4.0 and openfl 8.4.1.
Has this method of setting the scaleX/Y been deprecated? All the posts I’ve seen refer to the linked post are a couple years old.
And the result is “normal”.
If I specify a square NOMINAL format and redraw the background of the stage at each resize.
The square is well respected, and centered, as expected.
Hmm. It seems I made a mistake. I’m using HaxePunk on top of OpenFL/Lime, and the HaxePunk resizing functions don’t seem to work correctly right now, so I thought I’d try to directly access the stage and resize it myself. I mistakenly thought that Lib.current.stage would point to the same resource HaxePunk was using, but it doesn’t (should have been obvious :p).
After making a new project to test that code, I can confirm that it does scale as expected.
Unfortunately it looks like I’ll need to figure out why resizing the screen as in the HaxePunk demo also moves everything (or doesn’t update the camera?) so that most graphics are offscreen. If I could figure out how much it’s offset I could manually adjust the camera position, but I haven’t found a way to get that info yet.