Skip to main content
Participant
May 28, 2012
Answered

Universal iOS game with only one Stage setting?

  • May 28, 2012
  • 2 replies
  • 683 views

Hi guys

I'm currently working on a universal ios game for iphone and ipad.

I have one set of graphics set at 1024x768 and another set of graphics at 960x640. I use device capabilities to detect what kind of device I am on and then dynamically load the appropriate graphics at runtime.

My problem is that the stage is always set at 1024x768 so the application will automatically downscale the entire stage when it is running on the iphone. This means that it will scale down the appropriated sized 960x640 graphics and leave the extra blank space.

I've tried turning on no_scale and align left and all the different stage.scale settings with no luck.

I really wish I could just decide how big the stage is at runtime in a single file. Is this possible? I don't understand how someone would create a universal ios game with this setup. Am I missing something?

I've heard some people mention adding extra content that extends past the edges for one device and would be viewable on the other. This approach wouldn't work for me, however, because most of my ui elements are arranged at the edge of the screen.

Any help would be much appreciated.

This topic has been closed for replies.
Correct answer Colin Holgate

The iPad and iPhone are different aspect ratios, so you can't have a fixed graphic with UI elements on all four sides without there being a gap on one or the other device. If you only have controls on the top and bottom you could have a 1024x768 stage with extra content off of the left and right of the stage. If you just have controls down the left and right, you could have a 960x640 stage with extra content off of the top and bottom of the stage.

Now, if you have different graphics for the layout of the controls on all four sides, then you could do either of the above, but you would need to think carefully about the size of those graphics, it's not obvious. For example, if you go with a 1024x760 stage and extra content off of the left and right for the iPhone, then your iPhone graphics would be size to be 1152x768. At that size they would work perfectly for 960x640 and 480x320 screens.

In all of the above cases you would not set the stage scale or align, the default values are what you want.

For what it's worth, the 1024x768 and extra content to the left and right is the better option if you plan to support Android too, because both the iPhone and nearly all Android screens are wider than that ratio, there are no devices that are narrower than the iPad.

2 replies

Colin Holgate
Inspiring
May 28, 2012

Small modification to what I just said:

The iPhone graphics themselves can be 960x640, but on the 1024x768 stage they would be sized to 1152x768, and centered (therefore going off the left and right sides), then when the app runs they will be back at their correct size.

Colin Holgate
Colin HolgateCorrect answer
Inspiring
May 28, 2012

The iPad and iPhone are different aspect ratios, so you can't have a fixed graphic with UI elements on all four sides without there being a gap on one or the other device. If you only have controls on the top and bottom you could have a 1024x768 stage with extra content off of the left and right of the stage. If you just have controls down the left and right, you could have a 960x640 stage with extra content off of the top and bottom of the stage.

Now, if you have different graphics for the layout of the controls on all four sides, then you could do either of the above, but you would need to think carefully about the size of those graphics, it's not obvious. For example, if you go with a 1024x760 stage and extra content off of the left and right for the iPhone, then your iPhone graphics would be size to be 1152x768. At that size they would work perfectly for 960x640 and 480x320 screens.

In all of the above cases you would not set the stage scale or align, the default values are what you want.

For what it's worth, the 1024x768 and extra content to the left and right is the better option if you plan to support Android too, because both the iPhone and nearly all Android screens are wider than that ratio, there are no devices that are narrower than the iPad.