Screen orientation problem with background image

Hi All,

Ok, i've been having this problem whereby when I rotate the screen, the background image does a sort of flip and then the screen re-orientates (into portrait mode), it no longer fills the entire screen. Instead, the image seems to have been pushed to the left of the screen to show the background color underneath.

Any help/thoughts about this would be awesome as it's really starting to bug me and no matter what i try, i can't seem to fix it. I even created an adhoc version to test on my iPhone. Still the same thing.

Thanks in advance!

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @welshkiwi First to say, if haven't done so already, go into each scene > attributes and select Autorotate. Then select both Landscape Left as well as Right, or both Portrait and Portrait Upside Down.

    Next to say, the GS Viewer doesn't pay any attention to the screen orientation, unfortunately.... so you can't really test it.

    As for ad-hods, I thought they do "pay attention" to the orientations given, so maybe you haven't selected for each scene, as described above. Hope that helps.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • DaveGWelshDaveGWelsh Member Posts: 60
    @Gyroscope thanks for your help. Much appreciated!

    I did all that you suggested, (apart from setting Landscape left - do you need to do this for a portrait game?) it's really weird and bugging me out big time! lol :)

    Thanks though.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2014

    You're welcome. :-) And to clarify bit more (sorry to confuse you!) for landscape apps, you choose Landscape Left AND Landscape Right only; for portrait apps, you choose Portrait AND Portrait Upside Down only.

    Make sure, as I say, that whichever orientation you want, you choose the appropriate pair in each scene> Autorotate part.
    it's really weird and bugging me out big time! lol :)
    .
    I know, it's a bit disconcerting, isn't it, in the viewer when the screen goes any which way, no matter what orientation you've set... :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • DaveGWelshDaveGWelsh Member Posts: 60
    Heheh, thanks gyroscope! :)

    I made sure all the orientation settings are correct.

    What's annoying is that when I try it on the adhoc (publish etc), I still get the same problem.

    Would it have anything to do with the screen size? I'm doing a check to make sure it's running on the correct device and to scale the screen size accordingly.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2014

    Orientation has nothing to do with screen size...it could be you didn't select the orientation when you published for the ad-hoc...I forgot to mention you have to indicate orientation then as well....

    P.S I noticed you made a duplicate thread : minus ten points, @welshkiwi, ;-)... but seriously, just add another post to your own thread a few hours after to send it to the top again, rather than making another...causes confusion, you see.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • DaveGWelshDaveGWelsh Member Posts: 60
    Ah crap yeah. I forgot about that other thread! Argh! Sorry! This thing is driving me nuts.

    I setup the correct orientation in the Adhoc dev too.

    I noticed though that if you run the check to determine screen size, the problem happens, if you don't run the check (but my image is then stretched to fit an iPad), the problem does NOT happen.

    here's what I do for an iPhone 5S check

    when the screen size is 1024
    I change scene.camera.size.width to 768
    I change scene.camera.origin.X to -128

    This was from a tutorial on Youtube from GSHelper.

    This seems to be causing the issue.

    Any thoughts?
  • DaveGWelshDaveGWelsh Member Posts: 60
    Ok, an update for anyone with the same problem.

    What's happening is that when you rotate the iPhone, it seems to reset the scene in some ways and removes the offset from scene.camera.origin.X.

    What I therefore did was create a rule within the screen check that constrains the offset to the correct resolution, -128 for example. This then keeps the image in the correct place. It's not elegant, as you can sort of see the image shift a little but then move back into place, but at least it works.
  • DaveGWelshDaveGWelsh Member Posts: 60
    Does anyone know if there is a way to completely lock the image? I can do it without a screen check but to make the app universal I need to check the screen and make slight adjustments.
Sign In or Register to comment.