Permalink
Browse files

Updated readme to use markdown

Signed-off-by: Lanny McNie <lanny@gskinner.com>
  • Loading branch information...
1 parent 42b9c78 commit 46399dbe8216c95e8fff8502e38ddfc94a850eb0 @lannymcnie lannymcnie committed Jun 13, 2012
Showing with 59 additions and 28 deletions.
  1. +59 −0 README.md
  2. +0 −28 README.txt
View
59 README.md
@@ -0,0 +1,59 @@
+# 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.
+
+## 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);
+
+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 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.
+
+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...);
+
+All configuration properties default to false. The properties are:
+loop - indicates whether the tween should loop when it reaches the end
+useTicks - the tween will use ticks for duration instead of milliseconds
+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.
+
+
+## Support and Resources
+* Find examples and more information at the [TweenJS web site](http://tweenjs.com/)
+* 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.
+
+It was built by [gskinner.com](http://www.gskinner.com), and is released for free under the MIT license, which means you can use it for almost any purpose (including commercial projects). We appreciate credit where possible, but it is not a requirement.
+
+TweenJS is currently in alpha. We will be making significant improvements to the library, samples, and documentation over the coming weeks. Please be aware that this may necessitate changes to the existing API.
+
+## Classes
+
+**Tween**
+Returns a new Tween instance.
+
+**Timeline**
+The Timeline class synchronizes multiple tweens and allows them to be controlled as a group.
+
+**Ease**
+The Ease class provides a collection of easing functions for use with TweenJS. It does not use the standard 4 param easing signature. Instead it uses a single param which indicates the current linear ratio (0 to 1) of the tween.
+
+## Thanks
+Special thanks to [Robert Penner](http://flashblog.robertpenner.com/) for his easing equations, which form the basis for the Ease class.
View
28 README.txt
@@ -1,28 +0,0 @@
-SOUNDJS LIBRARY:
-
-SoundJS is a library to make working with audio on the web easier. It provides a consistent API for playing audio in different browsers, including using a target plugin model to provide an easy way to provide additional audio plugins like Web Audio, and a Flash fallback. A mechanism has been provided for easily tying in audio preloading to PreloadJS (http://preloadjs.com)
-
-The home page for SoundJS can be found at http://soundjs.com/
-
-There is a GitHub repository, which includes downloads, issue tracking, & a wiki at https://github.com/CreateJS/SoundjS/
-
-It was built by gskinner.com, and is released for free under the MIT license, which means you can use it for almost any purpose (including commercial projects). We appreciate credit where possible, but it is not a requirement.
-
-SoundJS is currently in alpha. We will be making significant improvements to the library, samples, and documentation over the coming weeks. Please be aware that this may necessitate changes to the existing API.
-
-
-The key classes are:
-
-SoundJS
-The core API for playing sounds. Simply call SoundJS.play(sound, options), and a sound instance is created that can be used to control the audio, and receive events when it is complete, loops, or is interrupted.
-
-SoundInstance
-A controllable sound object that wraps the actual plugin implementation, providing a consistent API for audio playback, no matter what happens in the background. Sound instances can be paused, muted, and stopped, and the volume, pan (where available), and position using the simple API.
-
-HTMLAudioPlugin
-The default, built-in plugin, which manages audio playback via the HTML5 <audio> tag.
-
-FlashPlugin
-An additional plugin which uses a flash shim (and SWFObject) to playback audio using Flash.
-
-Have a look at the included examples and API documentation for more in-depth information.

0 comments on commit 46399db

Please sign in to comment.