The UI scale is responsible for scaling UI components to help easy the burden of different device aspect ratios. The UI can expand either vertically or horizontally to fill excess space.
springroll.ScaleManager
[options]
[options]
Object
optional
The options
[size]
Object
optional
The dimensions of the Scaler
[items]
Object
optional
The items to load
[container]
PIXI.DisplayObjectContainer | createjs.Container
optional
The container if adding items
[display]
Object
optional
The current display
[enabled=false]
Boolean
optional
If the scaler is enabled
_getAdapter
display
Get the adapter by display
display
Object
The canvas renderer display
addItem
bitmap
settings
Add a bitmap to make be fullscreen
bitmap
PIXI.Sprite | createjs.Bitmap
The bitmap to scale
settings
String
Must be 'cover-image'
The instance of this ScaleManager for chaining
addItem
displayObject
[settings="center"]
Manually add an item
displayObject
createjs.DisplayObject | PIXI.DisplayObject
The display object item
[settings="center"]
Object | String
optional
The collection of settings or the align property
[align="center"]
String
optional
The vertical alignment ("top", "bottom", "center") then horizontal alignment ("left", "right" and "center"). Or you can use the short- handed versions: "center" = "center-center", "top" = "top-center", "bottom" = "bottom-center", "left" = "center-left", "right" = "center-right".
[titleSafe=false]
Boolean | String
optional
If the item needs to be in the title safe area. Acceptable values are false, "horizontal", "vertical", "all", and true. The default is false, and true is the same as "all".
[minScale=NaN]
Number
optional
The minimum scale amount (default, scales the same size as the stage)
[maxScale=NaN]
Number
optional
The maximum scale amount (default, scales the same size as the stage)
[centeredHorizontally=false]
Boolean
optional
Makes sure that the center of the object is directly in the center of the stage assuming origin point is in the upper-left corner.
[x]
Number
optional
The initial X position of the item
[y]
Number
optional
The initial Y position of the item
[scale]
Object
optional
The initial scale
[pivot]
Object
optional
The pivot point
[rotation]
Number
optional
The initial rotation in degrees
[hitArea]
Object | Array
optional
An object which describes the hit area of the item or an array of points.
[type]
String
optional
The instance of this ScaleManager for chaining
addItems
parent
items
Register a dictionary of items to the ScaleManager to control.
parent
The parent object that contains the items as variables.
items
Object
The items object where the keys are the name of the property on the parent and the value is an object with keys of "titleSafe", "minScale", "maxScale", "centerHorizontally", "align", see ScaleManager.addItem for a description of the different keys.
The instance of this ScaleManager for chaining
removeItem
display
Remove a single item from the scaler
display
createjs.Bitmap | PIXI.Sprite | createjs.Container | PIXI.DisplayObjectContainer
The object to remove
The ScaleManager for chaining
removeItems
parent
items
Remove all items where the item display is a the container or it contains items
parent
The object which contains the items as live variables.
items
Object
The items that was passed to addItems
The ScaleManager for chaining
removeItemsByParent
container
Remove all items where the item display is a child of the container display
container
createjs.Container | PIXI.DisplayObjectContainer
The container to remove items from
The ScaleManager for chaining
enabled
Whether the ScaleManager should listen to the stage resize. Setting to true initialized a resize.
Default: true