Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated readme

Signed-off-by: Lanny McNie <lanny@gskinner.com>
  • Loading branch information...
commit 7d9cec61bde8da7e069d905127bcfd4ef7397ce1 1 parent 586c843
@lannymcnie lannymcnie authored
Showing with 18 additions and 10 deletions.
  1. +18 −10 README.md
View
28 README.md
@@ -1,29 +1,36 @@
# TweenJS
-TweenJS is a simple tweening library for use in Javascript. It was developed to integrate well with the EaselJS library, but is not dependent on or specific to it (though it uses the same Ticker class by default). It supports tweening of both numeric object properties & CSS style properties.
+TweenJS is a simple tweening library for use in Javascript. It was developed to integrate well with the EaselJS library,
+but is not dependent on or specific to it (though it uses the same Ticker class by default). It supports tweening of
+both numeric object properties & CSS style properties.
## Example
The API is simple but very powerful, making it easy to create complex tweens by chaining commands.
- var tween = Tween.get(myTarget).to({x:300},400).set({label:"hello!"}).wait(500).to({alpha:0,visible:false},1000).call(onComplete);
+ var tween = createjs.Tween.get(myTarget).to({x:300},400).set({label:"hello!"}).wait(500).to({alpha:0,visible:false},1000).call(onComplete);
The example above will create a new tween instance that:
-- tweens the target to an x value of 300 over 400ms and sets its label to "hello!"
-- waits 500 ms
-- tweens the target's alpha to 0 over 1s & sets its visible to false
-- calls the onComplete function
+* tweens the target to an x value of 300 over 400ms and sets its label to "hello!"
+* waits 500 ms
+* tweens the target's alpha to 0 over 1s & sets its visible to false
+* calls the onComplete function
Tweens are composed of two elements: steps and actions.
-Steps define the tweened properties and always have a duration associated with them (even if that duration is 0). Steps are defined with the "to" and "wait" methods. Steps are entirely deterministic. You can arbitrarily set a tween's position, and it will always set the same properties for that position.
+Steps define the tweened properties and always have a duration associated with them (even if that duration is 0). Steps
+are defined with the "to" and "wait" methods. Steps are entirely deterministic. You can arbitrarily set a tween's
+position, and it will always set the same properties for that position.
-Actions do not have a duration, and are executed between steps. They are defined with the "call", "set", "play", and "pause" methods. They are guaranteed to execute in the correct order, but not at the precise moment in time that is indicated in the sequence. This can lead to indeterminate results, especially when tweens are interacting via the play and pause actions.
+Actions do not have a duration, and are executed between steps. They are defined with the "call", "set", "play", and
+"pause" methods. They are guaranteed to execute in the correct order, but not at the precise moment in time that is
+indicated in the sequence. This can lead to indeterminate results, especially when tweens are interacting via the play
+and pause actions.
This library is currently alpha. It has been tested (though not extensively), and is likely to change somewhat as it matures.
Tweens support a number of configuration properties, which are specified as the second param when creating a new tween:
-Tween.get(target, {loop:true, useTicks:true, css:true, ignoreGlobalPause:true}).to(etc...);
+createjs.Tween.get(target, {loop:true, useTicks:true, css:true, ignoreGlobalPause:true}).to(etc...);
All configuration properties default to false. The properties are:
loop - indicates whether the tween should loop when it reaches the end
@@ -32,11 +39,12 @@ css - enables css mapping for some css properties
ignoreGlobalPause - the tween will continue ticking even when Ticker is paused.
When using Tween.get, you can also specify true as the third parameter to override any active tweens on the target.
-Tween.get(target,null,true); // this will remove any existing tweens on the target.
+createjs.Tween.get(target,null,true); // this will remove any existing tweens on the target.
## Support and Resources
* Find examples and more information at the [TweenJS web site](http://tweenjs.com/)
+* Read the [documentation](http://createjs.com/Docs/TweenJS/)
* You can also ask questions and interact with other users at our [Community](http://community.createjs.com) site.
* Have a look at the included [examples](https://github.com/CreateJS/TweenJS/tree/master/examples) and [API documentation](http://createjs.com/Docs/TweenJS/) for more in-depth information.
Please sign in to comment.
Something went wrong with that request. Please try again.