Class: Shape

Shape

Shape

new Shape(parameters) → {Shape}

Describes a simple Quad of a single color.
Parameters:
Name Type Description
parameters Object Any initialization parameters as described by the DisplayObject documentation.
Author:
  • thegoldenmule
Source:
Returns:
Type
Shape

Extends

Members

alpha :number

A value between 0 and 1 that determines the alpha of this DisplayObject.
Type:
  • number
Inherited From:
Source:

geometry :Quad

The IGeometry implementation for this DisplayObject. Defaults to Quad.
Type:
  • Quad
Inherited From:
Source:

material :Material

The Material instance with chich to render this DisplayObject.
Type:
  • Material
Inherited From:
Source:

name :string

A non-unique name.
Type:
  • string
Inherited From:
Source:

tint :Color

A Color to tint this DisplayObject.
Type:
  • Color
Inherited From:
Source:

transform :Transform

The transform component to apply to this DisplayObject.
Type:
  • Transform
Inherited From:
Source:

visible :boolean

Toggles the visibility of this DisplayObject and all children.
Type:
  • boolean
Inherited From:
Source:

Methods

addChild(child) → {DisplayObject}

Adds a DisplayObject as a child of this one.
Parameters:
Name Type Description
child DisplayObject A DisplayObject instance to add as a child.
Inherited From:
Source:
Returns:
Type
DisplayObject

addChildren(children)

Adds a list of DisplayObjects as children.
Parameters:
Name Type Description
children Array an array of DisplayObjects to add as children.
Inherited From:
Source:

getChildByName(name) → {DisplayObject}

Returns a child by name, or null if no child by that name exists.
Parameters:
Name Type Description
name String The name of the child to return.
Inherited From:
Source:
Returns:
Type
DisplayObject

getChildren() → {Array}

Retrieves a copy of the array of children for this DisplayObject.
Inherited From:
Source:
Returns:
Type
Array

getHeight() → {number}

Returns the local height of the underlying geometry.
Inherited From:
Source:
Returns:
Type
number

getParent() → {DisplayObject}

Retrieves the parent DisplayObject.
Inherited From:
Source:
Returns:
Type
DisplayObject

getUniqueId() → {number}

All DisplayObject instances are assigned an id at instantiation that is unique across all DisplayObject instances. This function returns that value.
Inherited From:
Source:
Returns:
Type
number

getWidth() → {number}

Returns the local width of the underlying geometry.
Inherited From:
Source:
Returns:
Type
number

recalculateWorldMatrix() → {mat4}

Calculates the world matrix of this DisplayObject and returns it.
Inherited From:
Source:
Returns:
Type
mat4

removeAllChildren()

Removes all children from this DisplayObject.
Inherited From:
Source:

removeChild(child) → {DisplayObject}

Removes a DisplayObject from the list of children.
Parameters:
Name Type Description
child DisplayObject A DisplayObject instance to remove
Inherited From:
Source:
Returns:
Type
DisplayObject

removeChildren(children)

Removes a list of DisplayObjects as children.
Parameters:
Name Type Description
children
Inherited From:
Source:

removeFromParent()

Safely removes this DisplayObject from its parent.
Inherited From:
Source: