springroll.Positioner Class

Module: UI

Initially layouts all interface elements

Methods

generateHitArea

(
  • hitArea
  • scale
  • [adapter]
)
Object
static

Defined in generateHitArea:93

Create the polygon hit area for interface elements

Parameters:

  • hitArea Object | Array

    One of the following:

    // An array of points for a polygon. [{x:0, y:0}, {x:0, y:20}, {x:20, y:0}]

    // An object describing a rectangle. {type:"rect", x:0, y:0, w:10, h:30}

    // An object describing an ellipse, where x and y are the center. {type:"ellipse", x:0, y:0, w:10, h:30}

    // An object describing a circle, where x and y are the center. {type:"circle", x:0, y:0, r:20}

    // An object describing a sector, where x and y are the center of a circle // and start/end are the start and end angles of the sector in degrees. {type:"sector", x:0, y:0, r:20, start:0, end:90}

  • scale Number

    The size to scale hitArea by

  • [adapter] DisplayAdapter optional

    The adapter for the display being positioned in. If omitted, uses the Application's default display.

Returns:

Object:

A geometric shape object for hit testing, either a Polygon, Rectangle, Ellipse, Circle, or Sector, depending on the hitArea object. The shape will have a contains() function for hit testing.

init

(
  • display
  • settings
  • [adapter]
)
static

Defined in init:19

Initial position a single display object

Parameters:

  • display createjs.DisplayObject | PIXI.DisplayObject

    The display object to scale

  • settings Object

    The values for setting

    • [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

      • [x] Number optional
        The initial scale X value
      • [y] Number optional
        The initial scale Y value
    • [pivot] Object optional

      The pivot or registration point.

      • [x] Number optional
        The pivot point X location
      • [y] Number optional
        The pivot point Y location
    • [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. See generateHitArea().

      • [type] String optional
        If the hitArea is an object, the type of hit area, "rect", "ellipse", "circle", etc
  • [adapter] DisplayAdapter optional

    The adapter for the display being positioned in. If omitted, uses the Application's default display.