Container |

addChild

  • Parameters

    • child: any
    • Optionalz: number

    Returns Renderable

    the added child

addChildAt

angleTo

  • angleTo(target: any): number

    Returns number

    angle in radians

centerOn

  • Parameters

    • x: number
    • y: number

    Returns Container

    this rectangle

clone

  • Returns Rect

    new rectangle

contains

  • contains(x: number, y: number): boolean

    Parameters

    • x: number
    • y: number

    Returns boolean

    True if the polygon contain the point, otherwise false

  • Returns boolean

    True if the polygon contain the point, otherwise false

containsRectangle

  • containsRectangle(rectangle: Rect): boolean

    Parameters

    Returns boolean

    True if the rectangle contain the given rectangle, otherwise false

copy

distanceTo

  • distanceTo(target: any): number

draw

  • Returns void

equals

  • equals(rect: Rect): boolean

    Returns boolean

    true if equals

flipX

  • Parameters

    • Optionalflip: boolean = true

    Returns Renderable

    Reference to this object for method chaining

flipY

  • Parameters

    • Optionalflip: boolean = true

    Returns Renderable

    Reference to this object for method chaining

forEach

  • forEach(callback: Function, thisArg?: object): void

    Parameters

    • callback: Function
    • OptionalthisArg: object

    Returns void

getAbsolutePosition

  • getAbsolutePosition(): Vector2d

    Returns Vector2d

getBounds

  • Returns Bounds

    bounding box Rectangle object

getChildAt

  • Returns Renderable

    the child at the specified index

getChildByGUID

  • getChildByGUID(guid: string | number | boolean | RegExp): Renderable

    Parameters

    • guid: string | number | boolean | RegExp

    Returns Renderable

    corresponding child or null

getChildByName

  • getChildByName(name: string | number | boolean | RegExp): Renderable[]

    Parameters

    • name: string | number | boolean | RegExp

    Returns Renderable[]

    Array of children

getChildByProp

  • getChildByProp(
        prop: string,
        value: string | number | boolean | RegExp,
        objList?: any[],
    ): Renderable[]

    Parameters

    • prop: string
    • value: string | number | boolean | RegExp
    • objList: any[] = []

    Returns Renderable[]

    Array of childs

getChildByType

  • getChildByType(classType: object, objList?: any[]): Renderable[]

    Parameters

    • classType: object
    • objList: any[] = []

    Returns Renderable[]

    Array of children

getChildIndex

getChildren

getIndices

  • Returns number[]

    an array of vertex indices for all triangles forming this polygon.

getNextChild

getOpacity

  • Returns number

    current opacity value between 0 and 1

getRootAncestor

hasChild

isAttachedToRoot

  • isAttachedToRoot(): boolean

    Returns boolean

    true if this container is root or if it's attached to the root container

isConvex

  • isConvex(): boolean | null

    Returns boolean | null

    true if the vertices are convex, false if not, null if not computable

isFinite

  • Returns boolean

    false if all coordinates are positive or negative Infinity or NaN; otherwise, true.

lookAt

  • Returns Renderable

    Reference to this object for method chaining

moveDown

moveToBottom

moveToTop

moveUp

onCollision

  • Returns boolean

    true if the object should respond to the collision (its position and velocity will be corrected)

onDestroyEvent

  • Returns void

overlaps

  • overlaps(rect: Rect): boolean

    Returns boolean

    true if overlaps

postDraw

preDraw

  • Returns void

recalc

  • Returns Container

    Reference to this object for method chaining

removeChild

removeChildNow

  • removeChildNow(child: any, keepalive?: boolean): void

    Parameters

    • child: any
    • Optionalkeepalive: boolean

    Returns void

reset

  • Returns void

resize

  • Parameters

    • w: number
    • h: number

    Returns Container

    this rectangle

rotate

  • Parameters

    • angle: number
    • Optionalv: any

    Returns Renderable

    Reference to this object for method chaining

scale

  • Parameters

    • x: number
    • Optionaly: number = x

    Returns Renderable

    Reference to this object for method chaining

scaleV

  • Returns Renderable

    Reference to this object for method chaining

setChildsProperty

  • setChildsProperty(prop: string, value: object, recursive?: boolean): void

    Parameters

    • prop: string
    • value: object
    • Optionalrecursive: boolean

    Returns void

setOpacity

  • setOpacity(alpha: number): void

    Returns void

setShape

  • Returns Container

    this instance for objecf chaining

setSize

  • setSize(width: number, height: number): Container

    Parameters

    • width: number
    • height: number

    Returns Container

setVertices

  • Returns Container

    this instance for objecf chaining

shift

  • shift(x: number, y?: number): void

    Parameters

    • x: number
    • Optionaly: number

    Returns void

  • Returns void

sort

  • sort(recursive?: boolean): void

    Parameters

    • Optionalrecursive: boolean

    Returns void

swapChildren

to2d

  • Returns Container

    Reference to this object for method chaining

toIso

  • Returns Container

    Reference to this object for method chaining

toPolygon

  • Returns Polygon

    a new Polygon that represents this rectangle.

transform

  • Returns Renderable

    Reference to this object for method chaining

translate

  • translate(x: number, y?: number): Polygon

    Parameters

    • x: number
    • Optionaly: number

    Returns Polygon

    Reference to this object for method chaining

  • Returns Polygon

    Reference to this object for method chaining

union

Protectedupdate

  • update(dt: number): boolean

    Protected

    Returns boolean

    true if the Container is dirty

updateBounds

  • updateBounds(absolute?: boolean): Bounds

    Parameters

    • Optionalabsolute: boolean = true

    Returns Bounds

    this container bounding box Rectangle object