iPad portrait & landscape rotation question?
I'm playing catch up on the iPad development here with game salad. Am i right in thinking that if you release an iPad app unlike the iphone, it has to work in both landscape and portrait mode?
I believe I understand that the new GS 0.8.4 has some kind of built in rotate open, but how are you guys managing it so that if you have app developed in portrait mode, that objects such as backgrounds and men bars etc are correctly positioned and are the right length etc?
I believe I understand that the new GS 0.8.4 has some kind of built in rotate open, but how are you guys managing it so that if you have app developed in portrait mode, that objects such as backgrounds and men bars etc are correctly positioned and are the right length etc?
Comments
For left side of screen items or items calculated off the left side of your screen, you probably won't have to do anything to them. For center or right side calculated items, you will need to have a rule for autorotate that has nested rules for detecting orientation that then adjusts the center and right based items appropriately based on the new orientation's resolution. There are also project resolution system attributes to use in your equations too.
For the calculations of non-offset items (i.e. they are just out there), you could probably use some sort of ratio. It would be a ratio of current actor position to old orientation right (or center) versus new orientation right (or center).
`
old_pos new_pos
------- = -------
old_max new_max
`
Or instead of "max" maybe "center" if center based although the center stuff may require a little more than that. Too lazy to think that through. :-)
You will also want to adjust and custom screen wrapping code by using game attributes for the high value of X and Y positions.
So you need to check both Portrait AND Portrait Upside Down (or Landscape Right and Left) in EVERY Scene. Also, when you publish, you need to make sure both modes are selected as well.
That being said, you are able to, if you want, make your game rotate to ALL four directions, but you will need to reposition things like the HUD for instance.
There is a new condition that you can listen for in Rules called Auto-Rotate.
You'll need to then apply some math to your onscreen elements like rebump says above...
Tag team! ;-)
If I've segmented out my controls for a sidescrolling character out to the point where the "control rules" are separate from the actual propulsion/movement(i.e. controls set text variables that point the "movement rules" in the correct left or right direction) and tagged both "Left" and "Right" in the Horizontal auto-rotation section, then in theory, all I have to do is run a check on orientation right before I assign those variables back in the "control rules", correct?
Problem is, the only hooks I can find to reference orientation in GS itself is the "Auto-Rotate" check inside of the Rules Behavior...and that just flags "started" and "finished". Is there any variable I can reference in GS that will tell me explicitly that I'm "Left" or "Right" at any given time?
I had thought that I can set a game attribute to "regular" when the game starts and have a listener listen for "Auto-Rotate: finished" then flop them in a very boolean like setup. But I keep getting the wrong result. Which I can't determine whether it's just that I'm holding my device the "wrong way" when I fire up the viewer, or that something else is going on.
Is there an easier way?
Firemaple what do you mean by this? I am making a game in landscape...in every scene I do have landscape right and left checked. Is that fine for publishing? Or are you saying I need to have portrait checked as well or Apple will reject it??