CG.Layer Class
CG.Layer is a child of CG.Screen and a container to collect/group sprites, buttons, menus, emitters and animations
var l = new CG.Layer({
name: 'layerback'
})
Item Index
Properties
Methods
addElement
(
-
element
Add new element to the layer. This could be a CG.Sprite, CG.Animation, CG.Button and so on. Every thing that has a update and draw method ;o)
Parameters:
-
element
Objto add to elements array
draw
()
getElementByName
(
False/object
-
elementname
Find element by name (the first one)
Parameters:
-
elementname
Stringname of element to find in element array
Returns:
False/object:
returns false or the searched object
getElementsByName
(
Array
-
elementname
Find elements by name (if they have the same name ;o)
Parameters:
-
elementname
Stringname of element to find in element array
Returns:
Array:
returns a array of objects