Questions about ScaleMode
-
Hello everybody!
I'm new to HaxeFlixel, so sorry if I ask dumb questions.
- Changing the scaleMode has no effect on iOS, it is always using the default one. Is this the expected behavior?
- Is there a way to programatically change the background color of the window? Actually, I want to change the color of the black bars when the game is scaled according to the current state.
-
Hi, welcome!
- You can change the scaleMode programmatically with
FlxG.scaleMode
and ScaleModes for example:
FlxG.scaleMode = new FixedScaleMode();
- You can change the background color with changing the
FlxG.camera.bgColor
for example:
FlxG.camera.bgColor = FlxColor.BLUE;
or
FlxG.camera.bgColor = FlxColor.setRGB( 0, 0, 255, 255); // (RGBA)
- You can change the scaleMode programmatically with
-
- I already tried, and this works fine in flash, but won't work on iOS.
- This changes the background of the state, not the window: https://jumpshare.com/v/HYr043dCGfUGNVjHYqTY
-
- It seems that the only to change the window background color is through the
background
value in theProject.xml
file:
<window width="800" height="600" fps="60" background="#000000" hardware="true" vsync="false" />
- It seems that the only to change the window background color is through the
-
Probably this could work:
FlxG.stage.opaqueBackground = 0xffff0000;
-
None of those help.
https://jumpshare.com/v/hFEfVGCtDJLkco9vWdb1+
Looks like haxe is building the app in the size I defined in the Project.xml instead of using the original device resolution and scaling the game itself, and the black bars are added by iOS, so there is no way to change their color.