Class: StageContainer

StageContainer(renderer)

Stage container

Constructor

new StageContainer(renderer)

Creates an instance of StageContainer.
Parameters:
Name Type Description
renderer BatchRenderer
Source:

Extends

Classes

StageContainer

Members

callback :function

 Set/Get render callback
   - It will be called when the Item is rendered
Type:
  • function
Overrides:
Source:

(readonly) parent :BaseItem

Get parent
Type:
Overrides:
Source:

(readonly) premultipliedAlpha :number

Get premultiplied alpha
Type:
  • number
Overrides:
Source:

(readonly) stage :this

Get stage container
Type:
  • this
Overrides:
Source:

Methods

addChild(child)

Add BaseItem to the container
Parameters:
Name Type Description
child BaseItem
Overrides:
Source:

addChildAt(child, index)

Add BaseItem to a specific index
Parameters:
Name Type Description
child BaseItem
index number
Overrides:
Source:

callEventHandler(event)

 Handle event
   - It can handle mouse events if the item is interactive and has [onmouseover, onmouseout, onmousemove, onmousedown, onmouseup, onclick, ontouchstart, ontouchmove, touchend] function
Parameters:
Name Type Description
event *
Overrides:
Source:

contains(child) → {boolean}

Returns true, if the container contains the BaseItem
Parameters:
Name Type Description
child BaseItem
Overrides:
Source:
Returns:
Type
boolean

destruct()

Destruct class
Overrides:
Source:

empty()

Emptying the container
Overrides:
Source:

getBounds() → {Rectangle}

Returns with the bounds of the container
Overrides:
Source:
Returns:
Type
Rectangle

getChildAt(index) → {BaseItem}

Returns with a BaseItem from a specific index
Parameters:
Name Type Description
index number
Overrides:
Source:
Returns:
Type
BaseItem

getChildIndex(child) → {number}

Returns with the child element index
Parameters:
Name Type Description
child BaseItem
Overrides:
Source:
Returns:
Type
number

removeChild(child)

Removes the BaseItem from the container
Parameters:
Name Type Description
child BaseItem
Overrides:
Source:

removeChildAt(index)

Removes BaseItem from index
Parameters:
Name Type Description
index number
Overrides:
Source:

setChildIndex(child, index)

Set child element index
Parameters:
Name Type Description
child BaseItem
index number
Overrides:
Source:

swapChildren(childA, childB)

Swap two children
Parameters:
Name Type Description
childA BaseItem
childB BaseItem
Overrides:
Source:

update()

Update container data
Overrides:
Source: