Jump to content


Photo

Lock IOS screen rotation?


  • Please log in to reply
30 replies to this topic

#21 Kouri

Kouri

    GMC Member

  • GMC Member
  • 157 posts
  • Version:GM:Studio

Posted 04 July 2012 - 10:52 PM

NOTE : On Android there is a bug, that currently I cannot see how to fix, where for the very first frame in TEST mode then it will report the orientation of the device, and not lock until the next frame (so it may report the screen dimensions as portrait, because the device is held that way on the first frame).

Eheh, I found that out while doing some testing yesterday. I had been coming up with some code to auto-calculate view width based on the device screen ratio.

Getting the ratio was simple enough, I just used some code like:

ratio = display_get_width() / display_get_height();

And that worked well and dandy in the final apk and during most testing. However, as you said, if I held the device in Portrait while Testing, it reported the Portrait width and height, resulting in a distorted image once Landscape Lock kicked in. I fixed that relatively easily by forcing the game to calculate the longest dimension over the shortest:

ratio = max(display_get_width(), display_get_height()) / min(display_get_width(), display_get_height());

Then I'd just run the ratio calculations to get an undistorted view for any screen ratio.

Edited by Pabloco, 04 July 2012 - 10:53 PM.

  • 0

#22 Manuel777

Manuel777

    InvaderGames

  • GMC Member
  • 2857 posts
  • Version:GM:Studio

Posted 05 July 2012 - 02:51 AM

To fix the android bug just hold your device on the correct position before the runner loads, I already got used to do that (except when compiling, wich is what I do most of the times anyway)
  • 0

#23 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 1407 posts
  • Version:Unknown

Posted 05 July 2012 - 08:14 PM

No hurry from my point of view, but here is the issue I am having http://bugs.yoyogame...iew.php?id=4808

I am still not sure 100% if this is hexdump's issue as well, but I have explained it as clearly as I can in the tracker.

Landscape will allow any landscape orientation (we do not differentiate, why should we?)


This is the crux of the problem, there needs to be (preferrably a GML) way to lock one landscape orientation (so home left or home right) for certain applications. Those certain applications would be any that wish for the user to hold the iDevice flat and use tilt functions (ball rolling games etc.).

Without this, try making a ball rolling demo and use the tilt functions. you'll notice the view swaps upside down if you tilt it over certain threshold.


Sorry but we cannot do that as Apple do not like it, if it is landscape you should be able to hold the device whichever way you like - I would suggest that you have the game do it in such a way that they do not have to tilt that far e.g. you could exaggerate the tilt so that the user does not feel the need.

Russell
  • 0

#24 benetonmovie

benetonmovie

    GMC Member

  • GMC Member
  • 1368 posts
  • Version:GM:Studio

Posted 05 July 2012 - 08:16 PM

Russell has just closed this: http://bugs.yoyogame...iew.php?id=4808

And here's what he's saying:

Apple will not allow this - choosing Landscape allows either rotation - suggest you limit the tilt to normal ranges (i.e. exaggerate the effect so the user does not feel the need to rotate all the way round).


So Russell if you're reading this, you don't understand. Think about a game like this one: http://itunes.apple....d307758975?mt=8
The screen never switches between the two landscape resolutions because it would make the gameplay impossible. And not only has Apple allowed it, they featured it on their website for a while when the iPad was new. Please reconsider adding this feature! :biggrin:
  • 0

#25 Hugo_Peters

Hugo_Peters

    herp derp

  • GMC Member
  • 447 posts
  • Version:GM:Studio

Posted 05 July 2012 - 08:44 PM

Russell has just closed this: http://bugs.yoyogame...iew.php?id=4808

And here's what he's saying:

Apple will not allow this - choosing Landscape allows either rotation - suggest you limit the tilt to normal ranges (i.e. exaggerate the effect so the user does not feel the need to rotate all the way round).


So Russell if you're reading this, you don't understand. Think about a game like this one: http://itunes.apple....d307758975?mt=8
The screen never switches between the two landscape resolutions because it would make the gameplay impossible. And not only has Apple allowed it, they featured it on their website for a while when the iPad was new. Please reconsider adding this feature! :biggrin:

Tiny Wings has the same thing, it has a 'Flip Screen' option in the settings.
  • 0

#26 vann

vann

    GMC Member

  • GMC Member
  • 353 posts
  • Version:GM:Studio

Posted 06 July 2012 - 04:49 AM

So Russell if you're reading this, you don't understand. Think about a game like this one: http://itunes.apple....d307758975?mt=8
The screen never switches between the two landscape resolutions because it would make the gameplay impossible. And not only has Apple allowed it, they featured it on their website for a while when the iPad was new. Please reconsider adding this feature! :biggrin:


This was the exact game I recalled seeing this feature in when making this request. In the menus you can swap between the two landscape orientations, but as soon as the 'game field' launched, it won't rotate anymore. Go back to the menu and auto rotate is back. This has the exact functionality I was asking for, and clearly Apple have allowed it.

Edited by vann, 06 July 2012 - 04:57 AM.

  • 0

#27 hexdump

hexdump

    GMC Member

  • GMC Member
  • 360 posts
  • Version:GM:Studio

Posted 06 July 2012 - 07:11 AM


So Russell if you're reading this, you don't understand. Think about a game like this one: http://itunes.apple....d307758975?mt=8
The screen never switches between the two landscape resolutions because it would make the gameplay impossible. And not only has Apple allowed it, they featured it on their website for a while when the iPad was new. Please reconsider adding this feature! :biggrin:


This was the exact game I recalled seeing this feature in when making this request. In the menus you can swap between the two landscape orientations, but as soon as the 'game field' launched, it won't rotate anymore. Go back to the menu and auto rotate is back. This has the exact functionality I was asking for, and clearly Apple have allowed it.

Agreed!
  • 0

#28 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 1407 posts
  • Version:Unknown

Posted 06 July 2012 - 04:03 PM

Ok I will take a look at adding an os_lock_orientation( true/false ) call to enable and disable a lock to the current orientation would this cover what you need?

Russell
  • 0

#29 vann

vann

    GMC Member

  • GMC Member
  • 353 posts
  • Version:GM:Studio

Posted 07 July 2012 - 12:50 AM

Russell, as far as I can tell that would be perfect. That way the device can still auto-rotate to the most appropriate landscape view while in menus etc.
  • 0

#30 hexdump

hexdump

    GMC Member

  • GMC Member
  • 360 posts
  • Version:GM:Studio

Posted 08 July 2012 - 08:09 PM

Russell, as far as I can tell that would be perfect. That way the device can still auto-rotate to the most appropriate landscape view while in menus etc.


I think this will be the solution we are yearning for :). Thanks.
  • 0

#31 uffe

uffe

    GMC Member

  • New Member
  • 1 posts
  • Version:GM:Studio

Posted 30 July 2012 - 09:56 AM

Ok I will take a look at adding an os_lock_orientation( true/false ) call to enable and disable a lock to the current orientation would this cover what you need?

Russell


This sounds like a good solution, any indications as to when we might expect this implemented and published?

We have a fully developed and tested game, but the missing access to the underlying iOS orientation control functions are blocking our release.

Thanks for all you other great help.

Edited by uffe, 30 July 2012 - 12:57 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users