Mobile Resolution help
Hi, which screen width and height should i use to create a portrait mobile game?
Right now i`m using 1080x1920(Samsung Galaxy S4) but everything looks very small on screen.
I assume you have a version running on PC when you says everything looks small.
There's 2 approaches to this:
- Use a game size relative to screen resolution.
- Scale everything in your game
I use the latter in my game, scaling everything by a
scalevariable. Something like this:
var scale = Lib.current.stage.stageWidth / FlxG.width; // for example text.size = Std.int(50 * scale);
I've made everything looks the same in every resolution by doing this. I'll show you the source code when I get home.
@DleanJeans Okay, thank you. Just to clarify it´s normal size on my pc but small on my phone.
Take a look at my Settings.hx file. It uses this to calculate the
scalein portrait mode:
_scale = FlxG.width / playField.width;
You can replace
@DleanJeans Thank you for sharing your code! I think I've been able to integrate into my game.
doesn't haxeflixel already scale by itself?