Jump to content
Search Community

Throwprop Plugin Help

Asteroids test
Moderator Tag

Recommended Posts

This is the easiest way to get the duration:

 

import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.easing.*;
TweenPlugin.activate([ThrowPropsPlugin]);



//create a reference to the throwprops tween
var t = ThrowPropsPlugin.to(mc, {throwProps:{x:{velocity:150, resistance:50}, y:{velocity:70, resistance:50}}});

//get its duration()
trace(t.duration());

You can't change the duration of a tween once it has been created. You can change the timeScale though

t.timeScale(2) // will play twice as fast

In the very near future, there will be a VelocityTracker released as part of GSAP, which as its name implies will give you the current velocity of any object, whether it is being tweened, dragged, or moved some other way.

 

Currently the platform does not provide a built-in way to get the current velocity of an object.

 

In the meantime, you can use the velocity tracking shown in the ThrowProps docs:

 

http://api.greensock.com/as/com/greensock/plugins/ThrowPropsPlugin.html

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...