@@ -58,15 +58,17 @@ The next example shows how to create a Transition<Vector2f>:
58
58
59
59
Vector2f myVector = new Vector2f();
60
60
Vector2fConverter vector2fConverter = new Vector2fConverter();
61
- Transitions.transition(myVector, vector2fConverter) // This line asks for a TransitionBuilder
61
+ Transition<Vector2f> transition = Transitions.transition(myVector, vector2fConverter) // This line asks for a TransitionBuilder
62
62
.start(new Vector2f(10, 10)) // This line defines the starting value of the transition
63
- .end(5f, new Vector2f(50, 50)); // This line defines the ending value and the duration of the transition.
63
+ .end(5f, new Vector2f(50, 50)) // This line defines the ending value and the duration of the transition.
64
+ .build(); // This line actually builds the Transition
64
65
65
66
TransitionBuilder allows also to specify the values in float arrays instead having to create new objects, for example:
66
67
67
- Transitions.transition(myVector, vector2fConverter) // This line asks for a TransitionBuilder
68
+ Transition<Vector2f> transition = Transitions.transition(myVector, vector2fConverter) // This line asks for a TransitionBuilder
68
69
.start(10f, 10f) // This line defines the starting value of the transition
69
- .end(5f, 50f, 50f); // This line defines the ending value and the duration of the transition.
70
+ .end(5f, 50f, 50f) // This line defines the ending value and the duration of the transition.
71
+ .build(); // This line actually builds the Transition
70
72
71
73
### TypeConverter
72
74
@@ -142,7 +144,8 @@ Start by creating a new transition:
142
144
Vector2fConverter vector2fConverter = new Vector2fConverter();
143
145
Transition<Vector2f> transition = Transitions.transition(myVector, vector2fConverter)
144
146
.start(0f, 0f)
145
- .end(5f, 50f, 50f);
147
+ .end(5f, 50f, 50f)
148
+ .build();
146
149
147
150
Now, in some part of the code (probably the update method if you are making a game) you have to update the transition in order to let it interpolate the values of your object instance:
148
151
0 commit comments