background preloader

Screen resolution and Orientation

Facebook Twitter

Aymeric Lamboley » Working with multi-resolutions assets. When we’re making mobile apps we have to support lots of resolution from 480 x 320 to 2048 x 1536 if you only target iOS.

Aymeric Lamboley » Working with multi-resolutions assets

Adding Android support you have to extend it to 2560 x 1600 (for the Nexus 10)! If your graphic designer made its design into a vector format, it will be easy to fit exactly to your screen size, and you will only fight with the different ratios format. Rotation on android « Starling Forum. I saw you had another recent post here where you were asking about disabling device rotation and rotating your parent sprite instead, but I assume here you are not doing that but allowing the device to autoOrient?

Rotation on android « Starling Forum

Maybe this is what you are experiencing...: On Android (unlike iOS) device rotation will always (100% I think) cause loss of the Stage3D context3D. This screen change may just be a result of loosing context and textures needing to be reloaded for the newly built context. I think with my tests I have found that at least the backgroundColor set in your main startup Sprite is painted during this time [SWF(..., backgroundColor="... ")] Maybe someone else has a better trick on Android for having something more pleasant shown during context3D loss on Android autoOrient (maybe by throwing something up on the native stage? Lost context on orientation change on Android. « Starling Forum. Help me to understand ViewPort concept « Starling Forum. Hi all, I'm reading a lot of Starling tutorial lately and especially about multi-size/resolution screens.

Help me to understand ViewPort concept « Starling Forum

But I'm not sure to understand quite well the concept of viewPort and I'm pretty sure I should ! What I understand is : Using screen orientation APIs for smartphone application development. Physical orientation is the actual orientation of the device in real space.

Using screen orientation APIs for smartphone application development

This value is completely independent of anything that is happening in the software or how the content is presented. In ActionScript we access this information from within the Stage class using the deviceOrientation property. The deviceOrientation property is read-only and cannot be changed by the developer at runtime or in the application descriptor file. Valid values for this property can be found on the StageOrientation class and include DEFAULT, ROTATED_LEFT, ROTATED_RIGHT, UPSIDE_DOWN and UNKNOWN. The value of the deviceOrientation property changes as the device's accelerometer detects movement and changes in the position and orientation of the device. Both events will give you information on the orientation before and after a change in the position or orientation of the device through the afterOrientation and beforeOrientation properties.

Here's how that works in code: App resolutions « Starling Forum. No not automatically.

app resolutions « Starling Forum

As Daniel states above, the latest Starling will support a 'scale' property on textures as well as scaled rendered text based on a computed Starling.contentScaleFactor. It is up to your code though to use non 1.0 scale values. Starling.contentScaleFactor is not something you set directly but is a computed ratio of your current Starling stage's viewport size compared to the stage's stageWidth/stageHeight. Managing multiple iOS resolutions with Starling – real world example – Part 2: iPhone 5 and iPad. Developing Exoskeleton - Starling, AIR crossplatform game. It was the days of AIR 2.6 & we realized that it was not a very practical thing to do in terms of performance.

But things have evolved or rather took revolutionary paths with Adobes focus onto gaming & the release of Stage3D. Csharks was finally able to revisit the AIR development model with Exoskeleton. Play the game for FREE! The game was simple & straight forward & we had stripped down the features as well as functionality as the main aim was to have a working prototype to understand the feasibility of this model of development. Couple of issues which we faced initially were 1. limitation of the starling texture atlas to support multiple asset sets for different screen sizes 3. memory getting used up in iPad1 & older generation iPod devices 4. lack of monetisation methods directly addable. 5. lack of global score tracking, leader board system for cross platform deployment. 6. too much hacking & command line stuff as we were using Flash builder 4 ;)

Supporting the multiple screen sizes of multiple devices in Adobe AIR. Whether you're adapting a game that runs in Flash Player in the browser to run on iOS (using Adobe AIR) or writing an Adobe AIR application for Android tablets, you'll need to support at least a few different screen resolutions.

Supporting the multiple screen sizes of multiple devices in Adobe AIR

My post-apocalyptic strategy game Rebuild (for more background, read the Rebuild postmortem) was designed to be played in the browser with Flash Player at 800 x 600 pixels, so it took a few tricks to adapt it to run on the plethora of mobile devices out there. In this article, I share some of those tricks (based on Adobe AIR 3.2) and sample code for: Detecting screen sizeForcing orientationCalculating physical dimensionsScaling and centering an interfaceConverting vectors to scaled bitmapsDetecting and limiting Apple iOS devicesLimiting Android devices There are four different ways to check dimensions.

The stage.width and stage.height properties indicate the width and height of the contents of the stage in pixels. Fitting the game to in any screen resolution. For my Beekyr Android game it all started as 720p as it would be a Flash game, but then I realized that the game needed to work in 800x480 for my smartphone...

Fitting the game to in any screen resolution.

After that, I realized I needed to make it work in more resolutions for the rest of all Android phones out there. I had to think a way to scale the game and assets.... Turned out that is wasn't that hard! Basically, I had to work always with 720p in mind. When the game loads I need to work out a conversion rate for the resolution. Then apply this REDUCTION_RATIO variable to every loaded asset, positions,speeds and basically everything that involved pixels. Examples: params.height = size.w*REDUCTION_RATIO; params.width = size.h*REDUCTION_RATIO; _bulletSpeed = 38*REDUCTION_RATIO; If using AssetManager, all the stretching will be done for you if you initialize it like this: assetsManager = new AssetManager (1 / GameVars.REDUCTION_RATIO, false); But if you are converting textures manually then convert them like this: