What I want to do is set a default size
X=1280
Y=720
And depending on de device, if the device has a 1980x1080p screen resolution, i want to zoom the game to these screen
Regards
--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to a topic in the Google Groups "HaxeFlixel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haxeflixel/aEOglMpvo10/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haxeflixel+...@googlegroups.com.
Visit this group at http://groups.google.com/group/haxeflixel.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/d277daf4-db1a-4faa-bd95-a8016ef145f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"// var gameHeight:Int = 360; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).var gameWidth:Int; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom)"
"private function setupGame():Void {gameWidth = positions.gameWidth;gameHeight = positions.gameHeight;var stageWidth:Int = Lib.current.stage.stageWidth;var stageHeight:Int = Lib.current.stage.stageHeight;if (zoom == -1) {var ratioX:Float = stageWidth / gameWidth;//var ratioY:Float = stageHeight / gameHeight;
//zoom = Math.min(ratioX, ratioY);
zoom = ratioX;
gameWidth = Math.ceil(stageWidth / zoom);gameHeight = Math.ceil(stageHeight / zoom);}"
"menu.loadGraphic(AssetPaths.menu__png, false, positions.bgWidth, positions.bgHeight);menu.x = FlxG.width - menu.width;menu.y = FlxG.height - menu.height;"
import flixel.system.scaleModes.FillScaleMode;
...
public function FillScreen():Void
{
var a:FillScaleMode = new FillScaleMode();
FlxG.scaleMode = a;
}
So I have to control my aspect ratio, haven't I?
If you just want to fill the screen with the game you can do:
import flixel.system.scaleModes.FillScaleMode;
...
public function FillScreen():Void
{
var a:FillScaleMode = new FillScaleMode();
FlxG.scaleMode = a;
}
But this will stretch the game in a ugly way if the screen size is not the same aspect ratio.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/669f3954-3cea-4f1d-8847-7bfc14873db8%40googlegroups.com.