Class enchant.Group
A class that can hold multiple enchant.Node.
- Defined in: enchant.js
- Extends enchant.Node
Constructor Attributes | Constructor Name and Description |
---|---|
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.
|
|
removeChild(node)
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.
{Number}
scaleY
Scaling factor on the y axis of the Group.
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.