Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2016-0-4 21:22

Class enchant.Group

A class that can hold multiple enchant.Node.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Child Nodes.
 
The Node which is the first child.
 
The Node which is the last child.
 
origin point of rotation, scaling
 
origin point of rotation, scaling
 
Group rotation angle (degree).
 
Scaling factor on the x axis of the Group.
 
Scaling factor on the y axis of the Group.
Fields borrowed from class enchant.Node:
age, parentNode, scene, x, y

Method Summary

Method Attributes Method Name and Description
 
addChild(node)
Adds a Node to the Group.
 
insertBefore(node, reference)
Incorporates Node into Group.
 
Remove a Node from the Group.
Methods borrowed from class enchant.Node:
moveBy
moveTo
Methods borrowed from class enchant.EventTarget:
addEventListener
clearEventListener
dispatchEvent
on
removeEventListener

Class Detail

enchant.Group()
var stage = new Group();
stage.addChild(player);
stage.addChild(enemy);
stage.addChild(map);
stage.addEventListener('enterframe', function() {
    // Moves the entire frame in according to the player's coordinates.
    if (this.x > 64 - player.x) {
        this.x = 64 - player.x;
    }
});

Field Detail

{enchant.Node[]} childNodes
Child Nodes.
{enchant.Node} firstChild
The Node which is the first child.
{enchant.Node} lastChild
The Node which is the last child.
{Number} originX
origin point of rotation, scaling
{Number} originY
origin point of rotation, scaling
{Number} rotation
Group rotation angle (degree).
{Number} scaleX
Scaling factor on the x axis of the Group.
See:
enchant.Group#originX
enchant.Group#originY
{Number} scaleY
Scaling factor on the y axis of the Group.
See:
enchant.Group#originX
enchant.Group#originY

Method Detail

  • addChild(node)
    Adds a Node to the Group.
    Parameters:
    {enchant.Node} node
    Node to be added.
  • insertBefore(node, reference)
    Incorporates Node into Group.
    Parameters:
    {enchant.Node} node
    Node to be incorporated.
    {enchant.Node} reference
    Node in position before insertion.
  • removeChild(node)
    Remove a Node from the Group.
    Parameters:
    {enchant.Node} node
    Node to be deleted.