[RESOLVED]What is the trick to make an app fit all screen size?

Sorry to come up with so many troubles :frowning:

So the resizing seem to work with Android with couple issues. But the biggest issue to me is that the mouse touch event (mousedown moving) moves in an bizarre fashion. For example I click on an image then start moving it but the image moves fast to its left or right as in it is accelarating when it moves from the click center. Linux build has the same issue`.

This was not the case when I was using a non resized Window. It is peculiar.

Try using a window width and height of 0 in order to handle the resize and screen scale yourself on mobile

You’re probably handling the mouse event incorrectly. I assume you’re checking either e.mouseX and e.mouseY or stage.mouseX and stage.mouseY, right? Instead of that, you want to use image.parent.mouseX and image.parent.mouseY.

Post your code if you need more clarification.

1 Like

man so many awesome people here. Thanks for the tips. That gives me the right kind of heads up.

Thanks you all, @player_03 and @afroninjadotcom.
it works like a charm :slight_smile:
though I don’t quite understand the need for:

  • stage.align = untype “”;
  • and onResize(null);
    But thank you really!

It’s not in the documentation, but in Flash, you can center the stage by setting stageAlign = "". However, Haxe wants you to use an enum value, so you have to use untyped to make it ignore that.

onResize(null) is to resize the stage instantly. On Android, the stage will start at a different width and height, but you won’t get a RESIZE event until they rotate the device.

1 Like

Just want to add that I was using this solution. And it seems like it conflicts with the project.xml tag :

window allow-high-dpi=“true”

I had to remove the above tag to make the solution work. Took me much time to figure out.

1 Like