Easing motion plugin for scene objects on Share and Fork
Shri

Waders,

 

I have put together a little plugin to add easing motion to scene objects.

It is up in the share and fork area.

 

To add easing motion to a scene object, follow these three (3) simple steps

1. In your wade html file, load the easing plugin like you would any other wade plugin

-----------> <script src="./ashatej_easing.js"></script>

2. Create a scene object as you normally would

-----------> myObject = new SceneObject();

3. Call the scene objects newly aquired easeTo function

----------> mySceneObject.easeTo(x,y,speed,xEasing,yEasing,callback);

 

The six (6) easeTo parameters are as follow:

1. the target x location to move to - default 0

2. the target y location to move to - default 0

3. the speed of the motion - default 60

4. the x axis easing function - default linearEase

5. the y axis easing function - default linearEase

6. a callback function when the easing motion ends

 

Easing motion on the x and y axes can be different easing functions

ex: myObject.easeTo(100,100,400,'linearEase','easeInQuad'); 

 

The project is currently tagged as 'beta' because I figure there are some bugs/improvements

that can be made. I have done a little testing, but the more the better, so have at it.

 

If you look through the ashatej_easing.js file, you can see a full list of all the easing functions

as well as a couple of other calls in the plugin which may be useful.

 

If you look at easingDemo.js, you can see how to use the easing plugin.

 

Lastly, a big shout out to Gio for his help.

 

cheers,

Shri

No Comments Yet
Post a reply
Add Attachment
Submit Reply
Login to Reply