![]() |
Jumpvalley 0.5.0
An app and library that can be used to test and run 3D platformer levels. Currently being made with Godot.
|
Provides a way of tweening via Godot using method overrides.
The advantage of using this over a normal Godot Tween is that the Tween doesn't have to be in the scene tree in order to operate.
Another difference is that unlike a normal Godot Tween, this tween doesn't start automatically after being instantiated. Developers must call Resume() manually in order to get the tween running.
Syntax is inspired by JavaFX's animation package.
More...
Public Member Functions | |
MethodTween (double transitionTime, Tween.TransitionType transitionType, Tween.EaseType easeType) | |
double | GetCurrentValue () |
Returns the current value of the tween. This value is calculated by performing linear interpolation between InitialValue and EndingValue with the fraction between the value being CurrentFraction | |
bool | IsFinished () |
Returns if the tween is finished. The tween is considered to be finished if one of the following is true:
| |
virtual void | Pause () |
Pauses the tween. | |
virtual void | Resume () |
Starts or resumes the tween. | |
void | Step (double delta) |
Moves the current tweening position by a custom step in seconds. | |
void | Step () |
Calls Step(double) where the "double" argument is the number of seconds that Step() (with no arguments) was called. If this is the first time that Step() (with no arguments) was called since instantiation, the "double" argument will instead be the number of seconds since the tween started running. | |
virtual void | Dispose () |
Static Public Member Functions | |
static double | Lerp (double initVal, double finalVal, double frac) |
Returns a linear interpolation between an initial value and a final value for a given fraction. | |
Protected Member Functions | |
void | RaiseOnStep (float frac) |
void | RaiseOnResume () |
void | RaiseOnPause () |
void | RaiseOnFinish () |
Events | |
EventHandler< float > | OnStep |
Event that gets raised on each step of the tween until the animation pauses or finishes. The float argument of the event is the current fraction of the tween that has been completed so far, typically in the range of [0, 1]. Example usage: | |
EventHandler | OnResume |
Event raised when the tween resumes playback. | |
EventHandler | OnPause |
Event raised when the tween is paused during playback. | |
EventHandler | OnFinish |
Event raised when the tween finishes playback. This event only raises when IsFinished() would return true. See IsFinished() for more details. | |
Provides a way of tweening via Godot using method overrides.
The advantage of using this over a normal Godot Tween is that the Tween doesn't have to be in the scene tree in order to operate.
Another difference is that unlike a normal Godot Tween, this tween doesn't start automatically after being instantiated. Developers must call Resume() manually in order to get the tween running.
Syntax is inspired by JavaFX's animation package.
|
inline |
Returns the current value of the tween. This value is calculated by performing linear interpolation between InitialValue and EndingValue with the fraction between the value being CurrentFraction
|
inline |
Returns if the tween is finished.
The tween is considered to be finished if one of the following is true:
|
inlinestatic |
Returns a linear interpolation between an initial value and a final value for a given fraction.
initVal | The initial value |
finalVal | The final value |
frac | The fraction of the interpolation, typically in the range of [0, 1]. |
|
inline |
Moves the current tweening position by a custom step in seconds.
delta | The time in seconds to increment elapsed time in. |
EventHandler<float> Jumpvalley.Tweening.MethodTween.OnStep |
Event that gets raised on each step of the tween until the animation pauses or finishes.
The float argument of the event is the current fraction of the tween that has been completed so far, typically in the range of [0, 1].
Example usage:
MethodTween t = new MethodTween();
public void HandleTweenStep(object sender, float frac) { Console.WriteLine($"The current fraction of the tween is {frac}"); }
public void ConnectToTweenStep() { t.OnStep += HandleTweenStep; }