springroll.native.DisplayAdapter Class

Provide a normalized way to get size, position, scale values as well as provide reference for different geometry classes.

Methods

Properties

getBitmapSize

(
  • bitmap
)
Object
static

Defined in getBitmapSize:187

Get the original size of a bitmap

Parameters:

  • bitmap DOMElement

    The bitmap to measure

Returns:

Object:

The width (w) and height (h) of the actual bitmap size

getLocalBounds

(
  • object
)
createjs.Rectangle
static

Defined in getLocalBounds:79

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
  • [direction]
)
Object | Number
static

Defined in getPosition:128

Normalize the object position getting

Parameters:

  • object DisplayObject

    The 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
  • [direction]
)
Object | Number
static

Defined in getScale:93

Normalize the object scale

Parameters:

  • object DisplayObject

    The 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

(
  • container
)
static

Defined in removeChildren:202

Remove all children from a display object

Parameters:

  • container DisplayObjectContainer

    The display object container

setHitArea

(
  • object
  • shape
)
DisplayObject
static

Defined in setHitArea:174

Set the hit area of the shape

Parameters:

  • object DisplayObject

    The Display object

  • shape Object

    The geometry object

Returns:

DisplayObject:

Return the object for chaining

setPivot

(
  • object
  • pivot
  • [direction]
)
DisplayObject
static

Defined in setPivot:157

Set the pivot or registration point of an object

Parameters:

  • object DisplayObject

    The 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:

DisplayObject:

Return the object for chaining

setPosition

(
  • object
  • position
  • [direction]
)
DisplayObject
static

Defined in setPosition:110

Normalize the object position setting

Parameters:

  • object DisplayObject

    The display object

  • position Object | Number

    The position object or the value if the direction is set.

    • [x] Number optional

      The x value

    • [y] Number optional

      The y value

  • [direction] String optional

    Either "x" or "y" value

Returns:

DisplayObject:

Return the object for chaining

setScale

(
  • object
  • scale
  • [direction]
)
DisplayObject
static

Defined in setScale:142

Normalize the object scale setting

Parameters:

  • object DisplayObject

    The 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:

DisplayObject:

Return the object for chaining

Circle

Function static

Defined in Circle:16

The geometry class for Circle

Default: PIXI.Circle

Ellipse

Function static

Defined in Ellipse:25

The geometry class for Ellipse

Default: PIXI.Ellipse

Point

Function static

Defined in Point:52

The geometry class for point

Default: PIXI.Point

Polygon

Function static

Defined in Polygon:61

The geometry class for Polygon

Default: PIXI.Polygon

Rectangle

Function static

Defined in Rectangle:34

The geometry class for Rectangle

Default: PIXI.Rectangle

Sector

Function static

Defined in Sector:43

The geometry class for Sector

Default: PIXI.Sector

useRadians

Boolean static

Defined in useRadians:70

If the rotation is expressed in radians

Default: true