FeathersDisplayUtils
public class
feathers.utils.FeathersDisplayUtils
Description
Feathers Copyright 2012-2013 Joshua Tynjala. All Rights Reserved.
This program is free software. You can redistribute and/or modify it in accordance with the terms of the accompanying license agreement.
API overview
Constructor
Functions
Public functions
| calculateScaleRatioToFill ( originalWidth: Number , originalHeight: Number , targetWidth: Number , targetHeight: Number ): Number |
static Calculates a scale value to maintain aspect ratio and fill the required bounds (with the possibility of cutting of the edges a bit) |
| calculateScaleRatioToFit ( originalWidth: Number , originalHeight: Number , targetWidth: Number , targetHeight: Number ): Number |
static Calculates a scale value to maintain aspect ratio and fit inside the required bounds (with the possibility of a bit of empty space on the edges) |
| getDisplayObjectDepthFromStage ( target: DisplayObject ): Number |
static Calculates how many levels deep the target object is on the display list, starting from the Starling stage |
Constructor
FeathersDisplayUtils ()
Functions
calculateScaleRatioToFill ( originalWidth: Number , originalHeight: Number , targetWidth: Number , targetHeight: Number ): Number
static
Calculates a scale value to maintain aspect ratio and fill the required bounds (with the possibility of cutting of the edges a bit).
Parameters
| originalWidth: Number | |
| originalHeight: Number | |
| targetWidth: Number | |
| targetHeight: Number |
calculateScaleRatioToFit ( originalWidth: Number , originalHeight: Number , targetWidth: Number , targetHeight: Number ): Number
static
Calculates a scale value to maintain aspect ratio and fit inside the required bounds (with the possibility of a bit of empty space on the edges).
Parameters
| originalWidth: Number | |
| originalHeight: Number | |
| targetWidth: Number | |
| targetHeight: Number |
getDisplayObjectDepthFromStage ( target: DisplayObject ): Number
static
Calculates how many levels deep the target object is on the display list, starting from the Starling stage. If the target object is the stage, the depth will be 0. A direct child of the stage will have a depth of 1, and it increases with each new level. If the object does not have a reference to the stage, the depth will always be -1, even if the object has a parent.
Parameters
| target: DisplayObject |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |