How to target both iPhone and iPad resolution on Flash CS6 - ios

I am building a small game for iOS on Flash CS6 and I want to target both iPad and iPhone resolutions, also supporting retina display if possible. I've played with the movie properties and the Air for iOS settings, but I am still in confusion about the screen resolutions. I want to make a HD (retina-enabled) game, and I want to target the non-retina models too. Which resolution should I use? (I'll be having only landscape) Should I go with 2048x1536 (iPad Retina), 1024x768 (iPad non-retina), 960x640 (iPhone/iPod touch retina), or 480x320 pixels (iPhone/iPod touch non-retina)? I've set the resolution to High in Air for iOS settings, left the default resolution (960x640) unchanged, but when I tested it on iPad 3, the resolution wasn't HD, even though my graphics were vector (made in Flash). There was also background color visible around the corners, compensating for the aspect ratio difference of iPhone and iPad. Why can be the App rendering in non-retina resolution even though I've checked it at the settings for iOS? And more importantly, what is the best approach for targeting both screen resolutions in a single app?
Thanks,
Can.

Despite iOS being a resolution dependent OS, stage resolution doesn't matter. It will look the same if the stage resolution was 240x160 or 1920x1280. The device will render the game to it's native resolution. This is why you need to set the resolution in the publish settings: so that flash knows to add support for those resolutions for iOS. Setting the stage to 960x640 should be fine for the iPhone. When it publishes for iPad on the other hand, it will be built to it's native screen resolution, but because the iPhone and iPad have different aspect ratios, the iPad will have more space on the side. Since the game will be in landscape mode, it should be ok to simply put to thick black rectangles on the top and bottom of the stage.
As for the new iPad resolution, Flash isn't powerful enough to support that resolution, it will export to the standard iPad resolution of 1024x768 even if the resolution is set to high in the publish settings.
So pick the stage resolution based off of what device you favor, if you want the app to look best on the iPad's format, go for 1024x768, but the iPhone will have extra space on the sides in landscape mode. The same goes for the iPhone resolution I explained earlier. Although, if you'd like to fully support both, you can try many methods used to position GUI elements on the vast sea of Android Screens based off the Capabilities.screenResolutionX and Capabilities.ScreenResolutionY methods in flash.

Related

How can I find the 'safe region' for iPhone size if I am creating my app using iPad size?

I am creating a game and want to use the iPad size settings (landscape: 1024x768). From what I've learnt, using the iPad settings will crop out part of the height only on an iPhone. Say I have a 2048x1536 background image for iPad (1024x768) and a 2208x1242 image for iPhone 6+ (736x414),
i. how can I determine the 'safe region' from the iPad that will appear on the iPhone 6+ both point and pixel wise?
ii. will the 'safe region' for the iPhone 6+ be the same as the iPhone 6 (667x375) with a 1334x750 image? If not, how can it also be determined both point and pixel wise?
I assume you wish to create a universal game that runs both on iPad and iPhone. If that's the case, there are two possible approaches when defining your graphics assets in the Attributes Inspector (far right on your Xcode interface while Assets.xcassets is selected). In the Devices section, you can select among Universal, iPhone, iPad, Apple Watch, Apple TV, Mac and any combination of those.
If you select "Universal" only, then you will have to make sure that the assets you insert there will look good both on iPhone and iPad. If that's the case, see below some hints of how to make your assets safe for using universally.
If you select "iPad" and "iPhone", you will have to include separate assets for iPad and iPhone, with their appropriate resolutions and aspect ratios. In my past experience, I've always headed this way. For the iPad (1x) you will have to provide a 1024x768 background, for the iPad (2x) you will have to provide a 2048x1536, unless you choose "Single Scale" and use a single vector PDF file. Respectively, for the iPhone, you will have to provide a 480x320 (1x, only in case you need to support old devices such as iPhone 3G/3GS, quite unlikely given the fact Sprite-Kit was introduced with iOS7), then 1334x750 (2x), and 2208x1242 (3x, for the iPhone 6+, 6S+, 7+). With this approach you don't need to worry about "safe" zones, as the graphics you supply will be used on each device properly with no "cutting" off the edge. Just bear in mind that iPhone 4S and iPhone 5/5S/SE would need some background scaling in order to fit the whole 2x picture on the screen. Otherwise it would look zoomed in.
If you go with the first approach, then you should consider the following information in order to make your "universal" graphics safe for use with all devices:
iPhone 5/5S/SE...and all newer have a 16:9 display aspect ratio.
iPhone 4S has 3:2 aspect ratio (you only worry about that if your game will support iOS 9).
iPad screen aspect ratio is 4:3.
With the above in mind, there are two paths you could go:
1. Use 16:9 universal assets that will have their left/right parts cut off on iPad and iPhone 4S.
2. Use 4:3 universal assets that will have their upper/lower parts cut off on iPhones.
The above applies to your 2x assets as these will be used for both retina iPads and retina iPhones (4S, 5/5S, SE, 6/6S/7).
1x assets will only be used for non-retina iPads (iPad 2 in case you would support iOS 9, otherwise skip these too).
3x assets will only be used for the "Plus" iPhone models. So I suggest you provide these in 16:9 ratio (2208x1242) only.
So, how do you calculate your "safe" zones. Pretty straightforward:
Case 1 (16:9 assets to be used for iPad too): height 1536 (this is the retina iPad height in pixels, although if you wish to be pixel-perfect on iPad Pro 12.9" then you should increase that to 2048), width = 1536 * 16 / 9 = 2732 pixels wide (3640 pixels for iPad Pro support). Note that you will have to scale it down in run-time in order to fit for the iPhones. In order to avoid cutting off important content from your background, don't put anything to the left or right of the middle 2048 pixels of the 2732x1536 universal image (342 pixel "danger" zones on the left and right). If you go with a 3640x2048 image (supporting iPad Pro 12.9"), then only use the middle 2732 pixels, leaving only unimportant stuff in the 454-pixel-wide left and right boundaries.
Case 1b (same as above but with a smaller image): Another approach would be to use a native (iPhone 6/6S/7) 1334/750 pixels image, but then you will have to scale up for iPads, and scale down for iPhone 4S/5/5S/SE. In this case, your "safe" zone is 1000x750 (visible both on 4:3 iPads and 16:9 iPhones).
Case 2 (4:3 assets to be used for iPhones too): For the 2x assets use 2048x1536 pixel images. Depending on how you position the sprite on the screen there will be loses on the upper and/or lower parts. If it's centered, then your "safe" zone is 2048 / 16 * 9 = 1152, which leads to 2048x1152 in the middle of the 2048x1536 asset.
If you need any further clarification I will be happy to elaborate.

Preparing assets for iphone 6 spritekit games

I'm making a game in SpriteKit, and positioning cards with code. The size of the card texture needs to be different based on screensize or the layout is screwed. Same with background images of course, or ANY other layout. How does the iphone6 share the same #2x assets with the lower-res screens? It makes no sense. I've heard to design for the 6, and let the older phones down scale. but this doesnt seem to be what is happening. Everything is just cut off when checking on 5s. My assets for 6+ are fine, but of course it uses its own set of 3x images.
Display scale factor doesn't tell you everything you might want for choosing assets and laying out your screen — e.g. if all you have are #2x assets, they're used on both iPhone (4 and newer) and iPad (3 and newer) even though the iPad and iPhone have very different screen sizes.
SpriteKit's image loading falls back to UIKit's, which automatically picks the right scale factor for your device but not the right dimensions. So, much like how you have to do your own heavy lifting to choose different images for iPhone 4/4s vs iPhone 5/5s, you'll also need to look at the screen size yourself to pick images and/or do layout calculations on 3.5", 4", and 4.7" displays.
(Actually, you can get UIKit to automatically pick iPhone 3.5" vs iPhone 4" images if you use Xcode asset catalogs, but it doesn't look like those cover the 4" vs 4.7" issue. That's probably worth filing a bug about.)

ios, publish different build per device

Google Play allows different apks per screen density, does Apple Store support this?
I'm sure the info is somewhere, but all I find when I search are people asking how to develop one app to support all devices.
I know how to do that already, but this specific (top secret) project will be 1000 times better if I can release one super optimized version for each screen resolution... but I'll settle for density or device (generation and type) if needed.
I don't have access to XCode (no Mac) to check options currently.
Bonus points: If possible, is Apple going to frown on this and possibly reject my app because of this?
This can't be done. If your app supports the iPhone then it must support both 4" and 3.5" inch iPhones. If it supports only iOS 7 then you can avoid non-retina devices because only retina devices can run iOS 7.
But if you support the iPad you must support both retina and non-retina.
You can have one app (Universal) that does it all or you can have separate iPhone and separate iPad apps. But the iPhone app must support both sizes and possibly both types (retina and non-retina) of screens. And the iPad app must support both types of screens.
Apple won't accept apps that don't support the differences.
It should also be pointed out that in the Interface Builder part of Xcode, you setup the UI with points and not pixels. So, for an iPad, when you place a button, you do not have to specify retina or not. On a Retina screen a point is 2x2 pixels and on a non-retina screen a point is 1x1 pixels. Also, with image assets, you have a single image asset you ask for in code, but you add multiple copies of the image in the image assets. Like the retina and non-retina copies. If you have an image named cat.png, for retina this would be cat#2x.png and for non-retina it would be cat.png. But, in code or the inspector you would reference it with imageNamed:#"cat" and Objective-C is designed to handle the rest.

Poor OpenGL graphics Quality on First Generation iPad

I am using NinevehGL graphics library for rendering 3D models for an iOS application.
The rendering is quite good on the simulator and works well on iPhone 4S, iPad 2 and other recent devices.
But the quality is not as good on first generation iPad.
see the images
iPad(First Gen) As well as iPhone 3GS:
iPhone 4S:
Basically the gradient effect on iPad is very poor.. I am not worried about the antialiasing at the moment,, but I am worried about the clear difference in the gradient change of color.. in the first image one can clearly see the dark and bright regions.. but in the second image such regions are not so distinct.
Is this a device specific thing or are there any build settings that I can change to get better graphics for this version of iPad?

What resolution do I need to make images for universal iOS apps in?

I am making a Universal app on xCode 4.4, using Storyboards. I am making the images for this app in Photoshop. I want to make a background image that fills the whole screen.
What I want to know is:
What resolution do I make the images?
Do I need 1 for iPad and 1 for iPhone, or more?
How do you make it work with the iPhone 5 as well?
You might need up to 10 background images:
There's the retina iPad: 2048x1536, non retina iPad and iPad Mini: 1024x768, retina iPhone: 640x960, non-retina iPhone: 320x480 and the new iPhone 5 (retina only): 640x1136.
That's 5. If you want to support both landscape and portrait, then you have 10 combinations.
PS: If you decide to keep the status bar visible (as most apps do), then reduce the height with 20 pixels (40 pixels for retina displays). That's how much room is needed for the status bar.
You should consider the approach of using only one image. The user experience of most apps is poor if you dont respect the available canvas size.
And you might want to focus special areas of your artwork to the user.
I would propose you to implement different scenarios at least for iPad and iPhone.
The resolution itself is described within the specs. So use one for iPhone and one for iPad, the different logos are posted in two resolution, with a postfix #2x or for the new Appstore dimensions with another prefix, but all these details are within the specs.
My experience is that in most cases you have to organise the user interface separately in order to provide a good user experience.

Resources