springroll.easeljs.DisplayAdapter Class
Provide a normalized way to get size, position, scale values
as well as provide reference for different geometry classes.
contains
Boolean
static
If a container contains a child
Returns:
Boolean:
If the child contained within the container
getBitmapSize
Object
static
Get the original size of a bitmap
Returns:
Object:
The width (w) and height (h) of the actual bitmap size
getLocalBounds
createjs.Rectangle
static
Gets the object's boundaries in its local coordinate space, without any scaling or
rotation applied.
Parameters:
-
object
createjs.DisplayObject
The createjs display object
Returns:
createjs.Rectangle:
A rectangle with additional right and bottom properties.
getPosition
Object | Number
static
Normalize the object position getting
Parameters:
-
object
createjs.DisplayObject
The createjs display object
-
[direction]
String
optional
Either "x" or "y", default is an object of both
Returns:
Object | Number:
The position as an object with x and y keys if
no direction value is set, or the value of the specific direction
getScale
Object | Number
static
Normalize the object scale
Parameters:
-
object
createjs.DisplayObject
The createjs display object
-
[direction]
String
optional
Either "x" or "y" to return a specific value
Returns:
Object | Number:
A scale object with x and y keys or a single number if direction is set
removeChildren
static
Remove all children from a display object
setHitArea
createjs.DisplayObject
static
Set the hit area of the shape
Parameters:
-
object
createjs.DisplayObject
The createjs Display object
-
shape
Object
Returns:
createjs.DisplayObject:
Return the object for chaining
setPivot
createjs.DisplayObject
static
Set the pivot or registration point of an object
Parameters:
-
object
createjs.DisplayObject
The createjs Display object
-
pivot
Object | Number
The object pivot point or the value if the direction is set
-
[x]
Number
optional
The x position of the pivot point
-
[y]
Number
optional
The y position of the pivot point
-
[direction]
String
optional
Either "x" or "y" the value for specific direction,
default will set using the object.
Returns:
createjs.DisplayObject:
Return the object for chaining
setPosition
(
-
object
-
position
-
[direction]
)
createjs.DisplayObject
static
Normalize the object position setting
Parameters:
-
object
createjs.DisplayObject
The createjs display object
-
position
Object | Number
The position object or the value
if the direction is set.
-
[direction]
String
optional
Returns:
createjs.DisplayObject:
Return the object for chaining
setScale
createjs.DisplayObject
static
Normalize the object scale setting
Parameters:
-
object
createjs.DisplayObject
The createjs Display object
-
scale
Number
The scaling object or scale value for x and y
-
[direction]
String
optional
Either "x" or "y" if setting a specific value, default
sets both the scale x and scale y.
Returns:
createjs.DisplayObject:
Return the object for chaining
Circle
Function
static
The geometry class for Circle
Default: createjs.Circle
Ellipse
Function
static
The geometry class for Ellipse
Default: createjs.Ellipse
Point
Function
static
The geometry class for point
Default: createjs.Point
Polygon
Function
static
The geometry class for Polygon
Default: createjs.Polygon
Rectangle
Function
static
The geometry class for Rectangle
Default: createjs.Rectangle
Sector
Function
static
The geometry class for Sector
Default: createjs.Sector
useRadians
Boolean
static
If the rotation is expressed in radians
Default: false