new lime.Node()
Node. Abstract drawable object in lime.
- Source:
- node.js, line 22
Extends
- goog.events.EventTarget
Summary
Members |
||
---|---|---|
allow3DCSSTransform_ :boolean
Allow translate3d and other css optimizations
|
||
<private> |
customEvent_ :boolean
|
|
<private> |
eventHandlers_ :Object
Hash of active event handlers
|
|
inTree_ :boolean
Node has been added to DOM tree
|
||
supportedRenderers :Array.<lime.Renderer>
Supported renderers for Node
|
||
transitionsAdd_
type {Object.
|
||
transitionsClear_
type {Object.
|
Methods |
||
---|---|---|
<static> |
compareNode (n1, n2) → {number}
Compare two node positions in the tree
|
|
<static> |
getPropertyForTransition (transition) → {string}
Return CSS property name for transition constant
|
|
addEventListener ()
|
||
addTransition (property, value, duration, ease)
Register transition property. Use through animations.
|
||
appendChild (child, opt_pos) → {lime.Node}
Append element to the end of childrens array
|
||
calcRelativeQuality ()
Calculates relative quality change from the
parent objects quality
|
||
clearTransition (property)
Clear previously set transition
|
||
createDomElement ()
Create DOM element to render the node
|
||
getAnchorPoint () → {goog.math.Vec2}
Returns anchor point for the element.
|
||
getAutoResize () → {number}
Returns autoresize rules bitmask.
|
||
getBoundingBox (opt_frame) → {goog.math.Box}
Returns bounding box for element in parents coordinate space.
|
||
getChildAt (index) → {lime.Node|Element|null}
Return the child at defined index.
|
||
getChildIndex (child) → {number}
Return the index position of a child.
|
||
getCSS3DTransformsAllowed () → {boolean}
Returns css 3d transforms flag
|
||
getDeepestDomElement () → {Element}
Return deepest element in DOM tree that is used
for drawing the Node.
|
||
getDeepestParentWithDom () → {lime.Node}
Return deepest parent node that requires DOM element
for drawing on screen.
|
||
getDirector () → {lime.Director}
Return the Director instance related to the node.
Returns null if no director connection.
|
||
getDirty () → {number}
Return a bitmask of dirty values that need to be updated before next drawing
The bitmask parts are values of lime.Dirty enum
|
||
getFrame () → {goog.math.Box}
Returns a bounding box for the element in its own coordinate space
|
||
getHidden () → {boolean}
Returns true if element currently not visible
|
||
getMask () → {lime.Node}
Returns element used as a mask for current element
|
||
getNumberOfChildren () → {number}
Return number of childnodes current element has.
|
||
getOpacity () → {number}
Returns the opacity value of the Node. 0.0=100% trasparent, 1.0=100% opaque
|
||
getParent () → {lime.Node}
Return the parent object. Returns null in not in tree
|
||
<private> |
getParentStack_ () → {Array.<lime.Node>}
Return array of parent nodes until scene object
|
|
getPosition () → {goog.math.Coordinate}
Returns element's position coordinate
|
||
getQuality () → {number}
Returns elements quality value.
|
||
getRelativeQuality () → {number}
Return cumulative quality value relative to screen full quality.
|
||
getRotation () → {number}
Returns rotation angle for element in degrees
|
||
getScale () → {goog.math.Vec2}
Returns scale vector for the element. 1,1 means no scale.
|
||
getScene () → {lime.Scene}
Returns the Scene instance related to the node.
Returns null if no scene connection.
|
||
getSize () → {goog.math.Size}
Returns elements dimension
|
||
hitTest (e) → {boolean}
Checks if event should fire on element based on the position.
Before returning true this function should set the position property
of the event to the hit position in elements coordinate space
|
||
localToNode (coord, node) → {goog.math.Coordinate}
Convert coordinate in node space to other nodes coordinate space
|
||
localToParent (coord) → {goog.math.Coordinate}
Convert coordinate from current node space to
parent node space
|
||
localToScreen (coord) → {goog.math.Coordinate}
Convert coordinate in node space to screen coordinate
|
||
measureContents () → {goog.math.Box}
Return box containing current element and all its children
|
||
needsDomElement () → {boolean}
Does node require DOM element for drawing?
|
||
parentToLocal (coord) → {goog.math.Coordinate}
Covert coordinate form parent node space to
current node space
|
||
removeAllChildren () → {lime.Node}
Removes all children of a node.
|
||
removeChild (child) → {lime.Node}
Remove element from the childrens array
|
||
removeChildAt (index) → {lime.Node}
Remove element at a given index from the childrens array
|
||
removeDomElement ()
Remove DOM element connected to teh node
|
||
removeEventListener ()
|
||
runAction (action)
Add Node to action targets list and start the animation
|
||
screenToLocal (coord) → {goog.math.Coordinate}
Convert screen coordinate to node coordinate space
|
||
setAllow3DCSSTransforms (value) → {lime.Node}
Sets css 3d transforms rule (for DOM renderer).
XXX: This hack is required to fix a mobile Safari rendering bug.
It should only be used on nodes that are affected by the bug!
3D acceleration in css transforms is enabled by default and applied
for iOS and Playbook.
|
||
setAnchorPoint (value, opt_y) → {lime.Node}
Sets elements anchor point to new value. Anchor point is used
when positioning the element to position coordinate. [0,0] means
top left corner, [1,1] bottom right, [.5,.5] means that element
is position by the center. You can also pass in 2 numbers.
|
||
setAutoResize (value) → {lime.Node}
Sets new autoresixe rules. NOT IMPLEMENTED!
|
||
setChildIndex (child, index) → {lime.Node}
Move a child to another index in the childrens array.
|
||
setDirty (value, opt_pass, opt_nextframe) → {lime.Node}
Sets a dirty value true. This means that object needs that
kind of updates before next draw.
|
||
setHidden (value) → {lime.Node}
Sets if element is visible or not
|
||
setMask (value) → {lime.Node}
Sets element as a mask for current element
|
||
setOpacity (value) → {lime.Node}
Sets the opacity value of the Node object
|
||
setPosition (value, opt_y) → {lime.Node}
Sets new position for element. Also accepts 2 numbers(x and y value)
|
||
setQuality (value) → {lime.Node}
Sets quality value used while drawing. Not all rendermodes can draw
more effectively on lower quality. 1.0 full quality, 0.5 half quality.
Setting this walue larger than 1.0 almost never does anything good.
|
||
setRenderer (value) → {lime.Node}
Set renderer for the node. Renderer defines what lower
level technology will be used for drawing node on screen
|
||
setRotation (value) → {lime.Node}
Rotates element to specific angle in degrees
|
||
setScale (value, opt_y) → {lime.Node}
Sets new scale vector for element. This function also accepts
2 numbers or 1 number that would be coverted to vector before use
|
||
setSize (value, opt_height) → {lime.Node}
Sets dimensions for element. This funciton also
accepts 2 numbers: width,height
|
||
update (opt_pass)
Update modified dirty parameters to visible elements properties
|
||
updateDomElement ()
Update DOM element connected to the node
|
||
updateLayout ()
Update node's layout (tree relations)
|
||
wasAddedToTree ()
Handle adding Node to the DOM tree
|
||
wasRemovedFromTree ()
Handle removing Node from DOM tree
|
Members
-
allow3DCSSTransform_ :boolean
-
Allow translate3d and other css optimizations
- Source:
- node.js, line 40
-
<private> customEvent_ :boolean
-
- Source:
- node.js, line 195
-
<private> eventHandlers_ :Object
-
Hash of active event handlers
- Source:
- node.js, line 57
-
inTree_ :boolean
-
Node has been added to DOM tree
- Source:
- node.js, line 46
-
supportedRenderers :Array.<lime.Renderer>
-
Supported renderers for Node
- Source:
- node.js, line 87
-
transitionsAdd_
-
type {Object.
} - Source:
- node.js, line 30
-
transitionsClear_
-
type {Object.
} - Source:
- node.js, line 34
Methods
-
<static> compareNode(n1, n2) → {number}
-
Compare two node positions in the tree
Parameters:
Name Type Description n1
lime.Node First node. n2
lime.Node Second node. - Source:
- node.js, line 171
Returns:
Comparison result.- Type
- number
-
<static> getPropertyForTransition(transition) → {string}
-
Return CSS property name for transition constant
Parameters:
Name Type Description transition
number Transition constant. - Source:
- node.js, line 906
Returns:
Property name.- Type
- string
-
addEventListener()
-
- Source:
- node.js, line 1048
-
addTransition(property, value, duration, ease)
-
Register transition property. Use through animations.
Parameters:
Name Type Description property
number Transition property constant. value
* New value. duration
number Transition duration. ease
Array.<*> Easing function. - Source:
- node.js, line 1266
-
appendChild(child, opt_pos) → {lime.Node}
-
Append element to the end of childrens array
Parameters:
Name Type Argument Description child
lime.Node | Element | Node Child node. opt_pos
number <optional>
Position of new child. - Source:
- node.js, line 926
Returns:
obejct itself.- Type
- lime.Node
-
calcRelativeQuality()
-
Calculates relative quality change from the parent objects quality
- Source:
- node.js, line 500
-
clearTransition(property)
-
Clear previously set transition
Parameters:
Name Type Description property
number Transition property. - Source:
- node.js, line 1274
-
createDomElement()
-
Create DOM element to render the node
- Source:
- node.js, line 684
-
getAnchorPoint() → {goog.math.Vec2}
-
Returns anchor point for the element.
- Source:
- node.js, line 325
Returns:
Anchorpoint vector.- Type
- goog.math.Vec2
-
getAutoResize() → {number}
-
Returns autoresize rules bitmask.
- Source:
- node.js, line 521
Returns:
Autoresize bitmask.- Type
- number
-
getBoundingBox(opt_frame) → {goog.math.Box}
-
Returns bounding box for element in parents coordinate space.
Parameters:
Name Type Description opt_frame
goog.math.Box Optional frame box for element. - Source:
- node.js, line 1217
Returns:
Bounding box.- Type
- goog.math.Box
-
getChildAt(index) → {lime.Node|Element|null}
-
Return the child at defined index.
Parameters:
Name Type Description index
number Child index. - Source:
- node.js, line 965
Returns:
Child element.- Type
- lime.Node | Element | null
-
getChildIndex(child) → {number}
-
Return the index position of a child.
Parameters:
Name Type Description child
lime.Node | Element Child to search. - Source:
- node.js, line 978
Returns:
Index number.- Type
- number
-
getCSS3DTransformsAllowed() → {boolean}
-
Returns css 3d transforms flag
- Source:
- node.js, line 553
Returns:
- Type
- boolean
-
getDeepestDomElement() → {Element}
-
Return deepest element in DOM tree that is used for drawing the Node.
- Source:
- node.js, line 132
Returns:
Deepest DOM element.- Type
- Element
-
getDeepestParentWithDom() → {lime.Node}
-
Return deepest parent node that requires DOM element for drawing on screen.
- Source:
- node.js, line 141
Returns:
Deepest parent.- Type
- lime.Node
-
getDirector() → {lime.Director}
-
Return the Director instance related to the node. Returns null if no director connection.
- Source:
- node.js, line 1093
Returns:
Current director.- Type
- lime.Director
-
getDirty() → {number}
-
Return a bitmask of dirty values that need to be updated before next drawing The bitmask parts are values of lime.Dirty enum
- Source:
- node.js, line 202
Returns:
Dirty propertiest bitmask.- Type
- number
-
getFrame() → {goog.math.Box}
-
Returns a bounding box for the element in its own coordinate space
- Source:
- node.js, line 1201
Returns:
Contents frame in node space.- Type
- goog.math.Box
-
getHidden() → {boolean}
-
Returns true if element currently not visible
- Source:
- node.js, line 374
Returns:
True if node is hidden.- Type
- boolean
-
getMask() → {lime.Node}
-
Returns element used as a mask for current element
- Source:
- node.js, line 295
Returns:
Mask node.- Type
- lime.Node
-
getNumberOfChildren() → {number}
-
Return number of childnodes current element has.
- Source:
- node.js, line 956
Returns:
Number of children.- Type
- number
-
getOpacity() → {number}
-
Returns the opacity value of the Node. 0.0=100% trasparent, 1.0=100% opaque
- Source:
- node.js, line 652
Returns:
Opacity value.- Type
- number
-
getParent() → {lime.Node}
-
Return the parent object. Returns null in not in tree
- Source:
- node.js, line 916
Returns:
Parent node.- Type
- lime.Node
-
<private> getParentStack_() → {Array.<lime.Node>}
-
Return array of parent nodes until scene object
- Source:
- node.js, line 157
Returns:
Array of parents.- Type
- Array.<lime.Node>
-
getPosition() → {goog.math.Coordinate}
-
Returns element's position coordinate
- Source:
- node.js, line 271
Returns:
Current position coordinate.- Type
- goog.math.Coordinate
-
getQuality() → {number}
-
Returns elements quality value.
- Source:
- node.js, line 466
Returns:
Quality value.- Type
- number
-
getRelativeQuality() → {number}
-
Return cumulative quality value relative to screen full quality.
- Source:
- node.js, line 489
Returns:
Quality value.- Type
- number
-
getRotation() → {number}
-
Returns rotation angle for element in degrees
- Source:
- node.js, line 351
Returns:
Rotation angle.- Type
- number
-
getScale() → {goog.math.Vec2}
-
Returns scale vector for the element. 1,1 means no scale.
- Source:
- node.js, line 245
Returns:
scale vector.- Type
- goog.math.Vec2
-
getScene() → {lime.Scene}
-
Returns the Scene instance related to the node. Returns null if no scene connection.
- Source:
- node.js, line 1104
Returns:
Current scene.- Type
- lime.Scene
-
getSize() → {goog.math.Size}
-
Returns elements dimension
- Source:
- node.js, line 393
Returns:
Current element dimensions.- Type
- goog.math.Size
-
hitTest(e) → {boolean}
-
Checks if event should fire on element based on the position. Before returning true this function should set the position property of the event to the hit position in elements coordinate space
Parameters:
Name Type Description e
lime.events.Event Event object. - Source:
- node.js, line 1285
Returns:
If node should handle the event.- Type
- boolean
-
localToNode(coord, node) → {goog.math.Coordinate}
-
Convert coordinate in node space to other nodes coordinate space
Parameters:
Name Type Description coord
goog.math.Coordinate Local coordinate. node
lime.Node Node for new coordinate space. - Source:
- node.js, line 640
Returns:
Coordinate in node space.- Type
- goog.math.Coordinate
-
localToParent(coord) → {goog.math.Coordinate}
-
Convert coordinate from current node space to parent node space
Parameters:
Name Type Description coord
goog.math.Coordinate Local coordinate. - Source:
- node.js, line 613
Returns:
Parent coordinate.- Type
- goog.math.Coordinate
-
localToScreen(coord) → {goog.math.Coordinate}
-
Convert coordinate in node space to screen coordinate
Parameters:
Name Type Description coord
goog.math.Coordinate Local coordinate. - Source:
- node.js, line 601
Returns:
Screen coordinate.- Type
- goog.math.Coordinate
-
measureContents() → {goog.math.Box}
-
Return box containing current element and all its children
- Source:
- node.js, line 1241
Returns:
Bounding box.- Type
- goog.math.Box
-
needsDomElement() → {boolean}
-
Does node require DOM element for drawing?
- Source:
- node.js, line 122
Returns:
True if DOM is required.- Type
- boolean
-
parentToLocal(coord) → {goog.math.Coordinate}
-
Covert coordinate form parent node space to current node space
Parameters:
Name Type Description coord
goog.math.Coordinate Parent coordinate. - Source:
- node.js, line 575
Returns:
Local coordinate.- Type
- goog.math.Coordinate
-
removeAllChildren() → {lime.Node}
-
Removes all children of a node.
- Source:
- node.js, line 1020
Returns:
object itself.- Type
- lime.Node
-
removeChild(child) → {lime.Node}
-
Remove element from the childrens array
Parameters:
Name Type Description child
lime.Node | Element Child node. - Source:
- node.js, line 987
Returns:
object itself.- Type
- lime.Node
-
removeChildAt(index) → {lime.Node}
-
Remove element at a given index from the childrens array
Parameters:
Name Type Description index
number Index of element to remove. - Source:
- node.js, line 996
Returns:
object itself.- Type
- lime.Node
-
removeDomElement()
-
Remove DOM element connected to teh node
- Source:
- node.js, line 727
-
removeEventListener()
-
- Source:
- node.js, line 1072
-
runAction(action)
-
Add Node to action targets list and start the animation
Parameters:
Name Type Description action
lime.animation.Animation Animation to run. - Source:
- node.js, line 1298
-
screenToLocal(coord) → {goog.math.Coordinate}
-
Convert screen coordinate to node coordinate space
Parameters:
Name Type Description coord
goog.math.Coordinate Screen coordinate. - Source:
- node.js, line 562
Returns:
Local coordinate.- Type
- goog.math.Coordinate
-
setAllow3DCSSTransforms(value) → {lime.Node}
-
Sets css 3d transforms rule (for DOM renderer). XXX: This hack is required to fix a mobile Safari rendering bug. It should only be used on nodes that are affected by the bug! 3D acceleration in css transforms is enabled by default and applied for iOS and Playbook.
Parameters:
Name Type Description value
boolean allow(true) or disable(false). - Source:
- node.js, line 544
Returns:
object itself.- Type
- lime.Node
-
setAnchorPoint(value, opt_y) → {lime.Node}
-
Sets elements anchor point to new value. Anchor point is used when positioning the element to position coordinate. [0,0] means top left corner, [1,1] bottom right, [.5,.5] means that element is position by the center. You can also pass in 2 numbers.
Parameters:
Name Type Argument Description value
goog.math.Vec2 | number AnchorPoint vector. opt_y
number <optional>
Optionaly set anchorpoint with x,y. - Source:
- node.js, line 338
Returns:
object itself.- Type
- lime.Node
-
setAutoResize(value) → {lime.Node}
-
Sets new autoresixe rules. NOT IMPLEMENTED!
Parameters:
Name Type Description value
number New autoresize bitmask. - Source:
- node.js, line 529
Returns:
object itself.- Type
- lime.Node
-
setChildIndex(child, index) → {lime.Node}
-
Move a child to another index in the childrens array.
Parameters:
Name Type Description child
lime.Node Child node. index
number New index for the child. - Source:
- node.js, line 1033
Returns:
object itself.- Type
- lime.Node
-
setDirty(value, opt_pass, opt_nextframe) → {lime.Node}
-
Sets a dirty value true. This means that object needs that kind of updates before next draw.
Parameters:
Name Type Argument Description value
number Values to be added to the bitmask. opt_pass
number <optional>
Pass number (0-1). opt_nextframe
boolean <optional>
Register for next frame. - Source:
- node.js, line 214
Returns:
Node itself.- Type
- lime.Node
-
setHidden(value) → {lime.Node}
-
Sets if element is visible or not
Parameters:
Name Type Description value
boolean Hide(true) or show(false). - Source:
- node.js, line 382
Returns:
object itself.- Type
- lime.Node
-
setMask(value) → {lime.Node}
-
Sets element as a mask for current element
Parameters:
Name Type Description value
lime.Node Mask node. - Source:
- node.js, line 303
Returns:
object itself.- Type
- lime.Node
-
setOpacity(value) → {lime.Node}
-
Sets the opacity value of the Node object
Parameters:
Name Type Description value
number New opacity value(0-1). - Source:
- node.js, line 661
Returns:
The node object itself.- Type
- lime.Node
-
setPosition(value, opt_y) → {lime.Node}
-
Sets new position for element. Also accepts 2 numbers(x and y value)
Parameters:
Name Type Argument Description value
goog.math.Coordinate | number Position coordinate. opt_y
number <optional>
Optionaly set position using x,y. - Source:
- node.js, line 281
Returns:
object itself.- Type
- lime.Node
-
setQuality(value) → {lime.Node}
-
Sets quality value used while drawing. Not all rendermodes can draw more effectively on lower quality. 1.0 full quality, 0.5 half quality. Setting this walue larger than 1.0 almost never does anything good.
Parameters:
Name Type Description value
number New quality value. - Source:
- node.js, line 476
Returns:
object itself.- Type
- lime.Node
-
setRenderer(value) → {lime.Node}
-
Set renderer for the node. Renderer defines what lower level technology will be used for drawing node on screen
Parameters:
Name Type Description value
lime.Renderer Renderer object. - Source:
- node.js, line 98
Returns:
Node itself.- Type
- lime.Node
-
setRotation(value) → {lime.Node}
-
Rotates element to specific angle in degrees
Parameters:
Name Type Description value
number New rotation angle. - Source:
- node.js, line 360
Returns:
object itself.- Type
- lime.Node
-
setScale(value, opt_y) → {lime.Node}
-
Sets new scale vector for element. This function also accepts 2 numbers or 1 number that would be coverted to vector before use
Parameters:
Name Type Argument Description value
goog.math.Vec2 | number New scale vector. opt_y
number <optional>
Optionaly set scale using x,y. - Source:
- node.js, line 255
Returns:
Node itself.- Type
- lime.Node
-
setSize(value, opt_height) → {lime.Node}
-
Sets dimensions for element. This funciton also accepts 2 numbers: width,height
Parameters:
Name Type Argument Description value
goog.math.Size | number Elements new size. opt_height
number <optional>
Optionaly use widht,height as parameter. - Source:
- node.js, line 404
Returns:
object itself.- Type
- lime.Node
-
update(opt_pass)
-
Update modified dirty parameters to visible elements properties
Parameters:
Name Type Argument Description opt_pass
number <optional>
Pass number. - Source:
- node.js, line 768
-
updateDomElement()
-
Update DOM element connected to the node
- Source:
- node.js, line 715
-
updateLayout()
-
Update node's layout (tree relations)
- Source:
- node.js, line 740
-
wasAddedToTree()
-
Handle adding Node to the DOM tree
- Source:
- node.js, line 1145
-
wasRemovedFromTree()
-
Handle removing Node from DOM tree
- Source:
- node.js, line 1113