The base class for generic interpolating actions, you just pass set/get functions. More...
Public Member Functions | |
| delegate void | DSet (T value) |
| Target value set function delegate. | |
| delegate T | DGet () |
| Target value get function delegate. | |
| ActionTweenGeneric () | |
| ActionTweenGeneric constructor. | |
| ActionTweenGeneric (DGet dget, DSet dset) | |
| ActionTweenGeneric constructor. | |
| override void | Run () |
| Kick this action. | |
| override void | Update (float dt) |
| The update function. | |
Public Attributes | |
| T | TargetValue |
| The target value. | |
| bool | IsRelative = false |
| If true, the target value is an offset. | |
| DTween | Tween = (t) => Math.PowEaseOut(t,4.0f) |
| The tween/interpolation function, basically a f(x) function where f(x) goes from 0 to 1 when x goes from 0 to 1. | |
| DSet | Set |
| The function that sets the current value as we execute the tween. | |
| DGet | Get |
| The function that gets the current value as we execute the tween. | |
The base class for generic interpolating actions, you just pass set/get functions.
This is an abstract class.
| DTween Tween = (t) => Math.PowEaseOut(t,4.0f) |
The tween/interpolation function, basically a f(x) function where f(x) goes from 0 to 1 when x goes from 0 to 1.
Example of function you can set DTween to:
(t) => Math.Linear(t);
(t) => Math.ExpEaseIn(t,1.0f);
(t) => Math.ExpEaseOut(t,1.0f);
(t) => Math.PowEaseIn(t,4.0f);
(t) => Math.PowEaseOut(t,4.0f);
(t) => Math.PowEaseInOut(t,4.0f);
(t) => Math.BackEaseIn(t,1.0f);
(t) => Math.BackEaseOut(t,1.0f);
(t) => Math.BackEaseInOut(t,1.0f);
(t) => Math.PowerfulScurve(t,3.7f,3.7f);
(t) => Math.Impulse(t,10.0f);
(t) => FMath.Sin(t*Math.Pi*0.5f); // for sin curve tween
More about tweens can be found int he cocos2d documentaiton which itselfs points to:
http://www.robertpenner.com/easing/easing_demo.html
http://www.robertpenner.com/easing/penner_chapter7_tweening.pdf