Package | com.greensock.plugins |
Class | public class Physics2DPlugin |
Inheritance | Physics2DPlugin TweenPlugin Object |
reverse()
on the timeline to watch the particles retrace their steps right back to the beginning.
Keep in mind that any easing equation you define for your tween will be completely ignored for these properties.
0
)velocity
is defined. For example, if the object
should start out traveling at -60 degrees (towards the upper right), the angle
would be -60. (Default: 0
)useFrames
is true
, it would be measured per frame). You can either use gravity
or
acceleration
, not both because gravity is the same thing
as acceleration applied at an accelerationAngle
of 90. Think of gravity
as a convenience property that automatically sets the accelerationAngle
for you. (Default: null
)useFrames
is true
, it
would be measured per frame). To apply the acceleration in a specific
direction that is different than the angle
, use the accelerationAngle
property. You can either use gravity
or
acceleration
, not both because gravity is the same thing
as acceleration applied at an accelerationAngle
of 90. (Default: null
)accelerationAngle
of 180. If you define a
gravity
value, it will automatically set the accelerationAngle
to 90 (downward). (Default: null
)0
)"x"
property of the target object is used to control
x-axis movement, but if you'd prefer to use a different property name, use xProp
like xProp:"left"
. (Default: "x"
)"y"
property of the target object is used to control
y-axis movement, but if you'd prefer to use a different property name, use yProp
like yProp:"top"
. (Default: "y"
)USAGE:
import com.greensock.TweenLite; import com.greensock.plugins.TweenPlugin; import com.greensock.plugins.Physics2DPlugin; TweenPlugin.activate([Physics2DPlugin]); //activation is permanent in the SWF, so this line only needs to be run once. TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, gravity:400}}); //--OR-- TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, friction:0.1}}); //--OR-- TweenLite.to(mc, 2, {physics2D:{velocity:300, angle:-60, acceleration:50, accelerationAngle:180}});
Physics2DPlugin is a Club GreenSock membership benefit. You must have a valid membership to use this class without violating the terms of use. Visit http://www.greensock.com/club/ to sign up or get more details.
Copyright 2008-2013, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for Club GreenSock members, the software agreement that was issued with the membership.
Method | Defined By | ||
---|---|---|---|
Physics2DPlugin | |||
activate(plugins:Array):Boolean [static]
Activates one or more plugins so that TweenLite and TweenMax recognize the associated special properties. | TweenPlugin |