Fullscreen No Stretch

author:
Brinkbit Apps & Games
description:
simplifies dynamic object placement for fullscreen multi-resolution support
lastupdate:
2013-10-25
compatible:
v1.4
tag:
fullscreen, no stretch
homepage:
https://github.com/Brinkbit/StarlingFullScreenExtension
download:
https://github.com/Brinkbit/StarlingFullScreenExtension/archive/master.zip

Overview

This extension creates a second stage which sits on top of the root starling stage, allowing the root stage to stretch to fit the size of the screen without distorting your assets. The second stage maintains your desired aspect ratio, scaling up using the “show all” or “letterbox” method. The extension provides several properties to easily position your objects relative to screen edges, or to the stage.

Instead of initializing Starling the traditional way, replace the call to new Starling() with the following code:

var mStarling:Starling = FullScreenExtension.createStarling(Game, stage, width, height);

Then, whenever you add something to either your root class or to Starling.current.stage, add it instead to FullScreenExtension.stage. Example:

FullScreenExtension.stage.addChild(new ScreenNavigator());

Full explanation and tutorial: http://www.Brinkbit.com/blog/starling-fullscreen-extension/

Changelog

  • 2013/10/26 00:53: First public version

User Comments

Feel free to edit this part of the page!

  extensions/fullscreen-no-stretch.txt · Last modified: 2015/03/11 15:06 by 127.0.0.1
 
Powered by DokuWiki