Skip to content

Commit c3cf094

Browse files
author
void
committed
fix missing build() call in README.md documentation
1 parent 32fe508 commit c3cf094

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@ The next example shows how to create a Transition<Vector2f>:
5858

5959
Vector2f myVector = new Vector2f();
6060
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
6262
.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
6465

6566
TransitionBuilder allows also to specify the values in float arrays instead having to create new objects, for example:
6667

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
6869
.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
7072

7173
### TypeConverter
7274

@@ -142,7 +144,8 @@ Start by creating a new transition:
142144
Vector2fConverter vector2fConverter = new Vector2fConverter();
143145
Transition<Vector2f> transition = Transitions.transition(myVector, vector2fConverter)
144146
.start(0f, 0f)
145-
.end(5f, 50f, 50f);
147+
.end(5f, 50f, 50f)
148+
.build();
146149

147150
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:
148151

0 commit comments

Comments
 (0)