Adobe Air aspect ratio not working on iPad - actionscript-3

So we're using Adobe Air to develop iPad games from Flash for an educational kiosk that we're building. The issue is that some of the games are in portrait mode, and some of them look best in landscape mode. To account for this, we've ordered a swiveling kiosk that users can turn to either orientation depending on the game. All of the games are opened from a central app that we've developed as a "launcher" for them, so they're opened from within that other app instead of from the iOS home screen.
I'm using the "Aspect Ratio" command when publishing the game and setting to portrait or landscape depending on which game it is. I'm also setting the "Auto-Orientation" to false (though I've tried it on true as well and had similar issues). However, the two landscape games are showing up incorrectly as you can see in the image below. How can I force those games to show up properly on the iPad?

Keep auto orientation = false. Create your 'portrait' games on a portrait-oriented stage. Now create your 'landscape' games on that same portrait-oriented stage. Make them at their proper scale, so that they run off the stage. You can use a temporary landscape-stage-sized rectangle, on the lowest layer, to represent a proper landscape-oriented stage that you can compose on top of. When your game is all laid out select all layers and rotate the whole magilla 90-degrees. Presto! You just rotate the Pad to play the landscape games.
You may have to switch 'width' and 'height' references in your code for those games, and also 'x' and 'y' references. If you have many of those some simple matrix math will help with the transposition.

Related

HTML canvas expand beyond page but elements remain the same when it showing correctly

I am running a html game inside an iFrame. The game is displaying on a canvas.
I am testing the game on Chrome mobile simulator Pixel 5 device size 851x393
I was testing to see whether game display correctly when the user rotate the device.
portrait mode window.innerwith/height is showing as 851 1843
landscape mode window.innerwith/height is showing as 851 393
I am also puzzled, how can innter width/height change when the device rotate?
But the game does display correctly. Following are the elements of each state
Landscape
Portrait
With these settings the game display correctly.
When I rotate the device few times, the game got expand beyond the screen, as if we are looking at a zoomed upper left hand corner of the game.
However the elements seems to be exact match when it display correctly before. Even though game is not displaying correctly now.
Can anyone provide some assistance on this ?

Flash CS6 How Do You Edit A Scene In Landscape Mode?

I want my game to be played in landscape mode.
However, my app in CS6 is annoying to set down objects because when I'm adding stuff I see everything in Portrait mode, my quesiton is how can I change this so I'm editing/adding in landscape for Flash Professional CS6.
I found a solution. Create a new file, and have it set at the 800x480 landscape template, rather than the default.
There is probably a better way to do it, but this is the one I found.

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?

AIR Project Dimensions for Retina Support

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.

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