Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Changing phone orientation breaks HTML5 Scaling/Positioning — Gideros Forum

Changing phone orientation breaks HTML5 Scaling/Positioning

NinjadoodleNinjadoodle Member
edited July 2016 in General questions
Hi @hgy29

My game is setup for portrait - I would like to display a message in landscape mode that tells you to turn your phone.

The problem is that currently when I turn my phone to landscape ... for a second the game game gets scaled crossly into the centre, but a second later it gets scaled up and pushed out to the side.

Is there anyway to fix this orientation change issue? I have a few sponsorships lined up and one of the requirements is the message above.

Thank you heaps for any advice!

Comments

  • hgy29hgy29 Maintainer
    Does listening for resize events would allow you to know wether your device is in landscape or portrait ?

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • Hi @hgy29 - Thanks you. Yup I know about resize events - I was just trying to explain what I need to accomplish :)

    The problem is that the scaling is wrong when the phone is turned to landscape. The game is not centered and is pushed out to the side. This means that any message or image that I choose to display in landscape will do the same.
  • antixantix Member
    Can you use the same scaling in the different modes? I thought you would need to recalculate the scaling mode. for example..
    If you determined that fitWidth is best for the device in portrait mode, and then rotate to landscape mode then wouldn't you need to change the scaling to then fitHeight?

    Likes: Ninjadoodle

    +1 -1 (+1 / -0 )Share on Facebook
  • Hi @antix - thanks for pointing that out! I completely forgot about that. I'm gonna give this a go and see what happens.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    *crosses fingers*
Sign In or Register to comment.