Class Kinetic.Layer
Extends
Kinetic.Container, Kinetic.Node.
Defined in: kinetic.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Kinetic.Layer(config)
Layer constructor.
|
Method Attributes | Method Name and Description |
---|---|
add(node)
add a node to the layer.
|
|
afterDraw(func)
set after draw function handler
|
|
beforeDraw(func)
set before draw function handler
|
|
clear()
clears the canvas context tied to the layer.
|
|
draw()
draw children nodes.
|
|
get layer canvas
|
|
get layer context
|
|
get throttle
|
|
remove(child)
remove a child from the layer
|
|
setThrottle(throttle)
set throttle
|
- Methods borrowed from class Kinetic.Container:
- get, getChildren, isAncestorOf, removeChildren
- Methods borrowed from class Kinetic.Node:
- draggable, getAbsoluteAlpha, getAbsolutePosition, getAbsoluteTransform, getAbsoluteZIndex, getAlpha, getAttrs, getCenterOffset, getDetectionType, getDragBounds, getDragConstraint, getLayer, getLevel, getName, getParent, getPosition, getRotation, getRotationDeg, getScale, getStage, getTransform, getX, getY, getZIndex, hide, isDragging, isVisible, listen, move, moveDown, moveTo, moveToBottom, moveToTop, moveUp, off, on, rotate, rotateDeg, setAbsolutePosition, setAlpha, setAttrs, setCenterOffset, setDefaultAttrs, setDetectionType, setDragBounds, setDragConstraint, setPosition, setRotation, setRotationDeg, setScale, setX, setY, setZIndex, show, transitionTo
Class Detail
Kinetic.Layer(config)
Layer constructor. Layers are tied to their own canvas element and are used
to contain groups or shapes
- Parameters:
- {Object} config
Method Detail
add(node)
add a node to the layer. New nodes are always
placed at the top.
- Parameters:
- {Node} node
afterDraw(func)
set after draw function handler
- Parameters:
- func
beforeDraw(func)
set before draw function handler
- Parameters:
- func
clear()
clears the canvas context tied to the layer. Clearing
a layer does not remove its children. The nodes within
the layer will be redrawn whenever the .draw() method
is used again.
draw()
draw children nodes. this includes any groups
or shapes
getCanvas()
get layer canvas
getContext()
get layer context
getThrottle()
get throttle
remove(child)
remove a child from the layer
- Parameters:
- {Node} child
setThrottle(throttle)
set throttle
- Parameters:
- {Number} throttle
- in ms