AIR Project Dimensions for Retina Support - actionscript-3

I am a bit confused with how the project dimensions I set up in Flash Develop will affect my AIR Application's appearance on Retina and non-Retina iPad displays, and how to work with Bitmaps under these circumstances.
When I run in Flash Player on PC to debug the 2048x1536 is off of my monitor it's so big. I've heard that the stage will scale with the size of the screen, and is just a reference coordinate system, but I don't understand how Bitmaps would work in these conditions... Are the Bitmaps scaled automatically all too? Does it matter whether I set my project dimensions to 2048x1546?
My hesitance to get started with this is that I will be using some spritesheets via Starling and I am confused with how to treat their dimensions in these circumstances.
Plz set me straight if you have knowledge and a minute. Appreciated.

You don't have to use 2048x1536. You can just use 1024x768 for your project dimensions. Make sure that stage.scaleMode = StageScaleMode.SHOW_ALL; but that's the default if I'm not mistaken.
Retina iPads will just show it doubled, so everything gets scaled up to 2048x1536. That means your bitmaps won't look as sharp as they can be, but vector graphics DO look sharp because Flash uses the extra resolution on a retina screen.
You could write some code to use higher-resolution bitmaps if you're on a retina display but I don't actually know of a good way of detecting retina resolution other than checking the screen dimensions. Or you could use high-resolution bitmaps that will be scaled down on non-retina screens (make sure to allow smoothing).
Also, I don't have experience with Starling myself so that may behave differently. Hope this helps a bit anyway.

Related

libgdx working with sprite size

I am new to libgdx and i was wondering if someone could help me with sprite size.
my screen is set to be 1280 x 720. for my desktop it looks great and the right size that i need it to be. but when i test it on my android, the sprite is way to small. How do you make screen size consistent?
to animate my sprite, i followed this. https://code.google.com/p/libgdx/wiki/SpriteAnimation
If anyone could help, that would be awesome. thanks in advance
If your app is not going to have zoom feature (which is mostly the case), you should not decide sprite sizes in terms of pixels.
Since you are going to tackle so many screen sizes and resolutions, I'd suggest a way to handle sizing of sprites in a screen size and pixel density independent way.
Assume some resolution (probably largest that you'd like to provide support for) with a suitable aspect ratio.
Size and place your sprites properly in that stage as you like.
While drawing, scale it to the actual screen resolution. (Keep in mind what to do if the aspect ratio is less or more than you had intended).
This way, you are essentially setting sizes of sprites in terms of fraction of screen size which is really convenient to understand and your sprites will look same relative sizes on all resolutions.
Hope this helps.

how can I get my game to fullscreen in iPhone 5? using air 4.0

I am making a game in flash IDE using adobe air, want to make it landscape full screen, my stage size is 560x320 but it has unused screen on the sides. Can anyone guide me what is the small thing I am missing, rest full game is completed.
Thanks
Don't forget to add in the default image in particular for the iPhone5 you need:
Default-568h#2x.png
This makes sure your stage is the full area of the screen and not windowed. You can see all the sizes here:
http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac1e63e3d129907d2886-8000.html#WS901d38e593cd1bac58d08f9112e26606ea8-8000
Your aspect ratio is not like iPhone (16:10) so if you match your width then graphics will go out of screen vertically. You will have to continue your graphics design on blank area to keep the design continuity.
Still try using,
stage.displayState = StageDisplayState.FULL_SCREEN;
For more info see
stage.displayState

Can CreateJS handle device orientation changes and preserve state?

I'm trying to use CreateJS to export a Flash game to HTML5 and then package the result with PhoneGap for mobile devices. This works fine.
But now I'm trying to handle orientation changes, and I'm not sure how to do this. The Flash scene has a fixed landscape orientation, and CreateJS preserves this. But if I rotate the device, I would either need to re-layout the screen objects or switch to a different screen layout.
Redoing the layout would be hard, because the original scene doesn't do this, and so the emitted CreateJS code doesn't either, and I can't see how to override the massive machine generated code base.
But switching to a different layout seems like it would lose the state of the original screen, and that's no good.
Or is this issue why a lot of games seem to pick a single orientation and don't allow rotation at all?

HTML5 Canvas - Performance difference between portrait and landscape on retina display

We're using a scaling technique to improve the resolution of our canvas web apps on the retina display. Basically, the technique described here:
http://zsprawl.com/iOS/2012/03/html5-canvas-and-retina-displays/
However, we've noticed a SIGNIFICANT performance difference when running in landscape mode vs portrait mode. I've set up a jsFiddle test app to demonstrate this. You can notice the difference if you view the embedded version:
http://jsfiddle.net/SaJ69/embedded/result/
(removing the /embedded/result/ will take you to the original fiddle. I could only have a post with 2 links in it)
If you switch between portrait and landscape when viewing this on an iPad3 (you'll need to refresh the browser window between switches) you can see that portrait mode is choppier than landscape. When running this on my own webserver (not through jsFiddle), the results are much more noticeable.
I tried to do some frame rate metrics, but they're only measuring the number of times we make draw calls, not the number of times the browser will actually update.
Anyone have any insight into this? Is this a hardware related issue? We are theoretically doing the same draw calls and filling the same number of pixels right?
-Chris
It seems one working fix is to clamp the canvas width to 1023, so that the double density canvas is 2046 px wide; discovered by Arima & explained here:
http://www.scirra.com/forum/retina-ios-performance-problem-fix-please-test_topic58742.html
I ran into the same issue with landscape vs. portrait as well. This also happens on iPhone 4, 4s, and 5 - Anywhere Retina and double density canvas is involved. The only work around I have is to simply not use the double density trick until Apple fixes the issue.
But, if you were determined to use Retina, you could detect the orientation of the device and resize the canvas for double density only in landscape...

Starling game resolution in multiplataform

We're building a game in starling, and we want it to be multiplataform, but we found some problems with resolutions,
we have designed the game for iPad, and we want it to run in samsung galaxy tab 10.1 and iPhone,
The problem we have in SGT 10.1 is that we want to center the content and add an extra background to fix the black tires in the sides, and in iPhone 4, the content is bigger that the screen...
do you know a way to solve it?
Thanks
Here is a link that explains how to develop for multiple resolutions in starling:
http://wiki.starling-framework.org/manual/multi-resolution_development
If your assets were created from vector graphics, and don't want to stretch the result bitmap. or you don't want to include several texture atlases.
There's an open source library that should do the trick: https://github.com/XTDStudios/DMT
This library renders the vector assets according to what you give it, and cache it on the device.
online tutorial: http://goo.gl/6NhQk