Namespace NodeGraph.animator
| Extends: | SC.Object |
| Defined in: | frameworks/nodegraph/controllers/animator.js |
| Version: | 1.0 |
| Author: | Peter Bergstrom |
| Copyright: | 2008-2009 Peter Bergström. |
Overview
NodeGraph.animator
This is the NodeGraph animation engine. This runs every 40 milliseconds.
Property Summary
-
- (Array) _queue [R/W]The queue of animation subjects. -
- (DOM Element) _svgMain [R/W]A reference to a view's main SVG element. -
- (Integer) _svgMainHeight [R/W]The height of the svg element passed in.
Method Summary
-
- (void) addSubject(elm, props, duration, isSVG)Add a subject to the queue. -
- (void) addSubjects(arr, svgMain, svgMainHeight)Add an array of subjects to be animated. -
- (Boolean) runAnimation()Runs the animation one frame, this is called by the SC Timer object.
Property Details
_svgMain [R/W]
A reference to a view's main SVG element.
- DOM Element _svgMain
Discussion
Used to "snap" the element to prevent rendering/display bugs.
Method Detail
addSubject()
Add a subject to the queue.
- (void) addSubject (elm, props, duration, isSVG)
Parameters
(DOM Element)elm The subject to be animated.
props {Object} The properties that are to be animated.
duration {Integer} The duration in milliseconds of the element.
isSVG {boolean} Determines if it is an SVG element or not.
addSubjects()
Add an array of subjects to be animated.
- (void) addSubjects (arr, svgMain, svgMainHeight)
Parameters
arr {Array} The array of animation subjects.
(DOM Element)svgMain A reference to a view's main SVG element. Used to "snap" the element to prevent rendering/display bugs.
svgMainHeight {Integer} The height of the svg element passed in.
Discussion
Removes all the previous elements and starts the timer if is has been stopped.
runAnimation()
Runs the animation one frame, this is called by the SC Timer object.
- (Boolean) runAnimation ()
Returns
(Boolean) Returns NO if the queue is null.