Skip to content

Commit

Permalink
fix animation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aspiringLich committed Mar 9, 2023
1 parent 5dbdd7f commit e389b58
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/main/java/paintingcanvas/animation/AnimationBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* <pre>{@code
* Text text = new Text(100, 100, "Hello World");
* text.animate()
* .add(moveTo(200, 200), 3);
* .add(Animation.moveTo(200, 200), 3) // move to (200, 200) in 3 seconds
* .with(Animation.colorTo(Color.BLUE), 3) // change color to blue in 3 seconds
* .with(Animation.moveBy(100, 0), 3); // at the same time, move 100 pixels to the right
* canvas.sleep(); // wait for the animation to finish
* }</pre>
*/
public class AnimationBuilder {
Expand All @@ -24,8 +27,8 @@ public AnimationBuilder(Drawable<?> drawable) {
* <pre>{@code
* // these animations will run one after the other
* obj.animate()
* .add(moveTo(100, 100), 100, TimeUnit.Frames)
* .add(colorTo(Color.BLUE), 100, TimeUnit.Frames);
* .add(Animation.moveTo(100, 100), 100, TimeUnit.Frames)
* .add(Animation.colorTo(Color.BLUE), 100, TimeUnit.Frames);
* }</pre>
*
* @param animation The animation type to add
Expand Down Expand Up @@ -53,8 +56,8 @@ public AnimationBuilder add(Animation animation, double duration, TimeUnit unit)
* <pre>{@code
* // these animations will run one after the other
* obj.animate()
* .add(moveTo(100, 100), 10)
* .add(colorTo(Color.BLUE), 10);
* .add(Animation.moveTo(100, 100), 10)
* .add(Animation.colorTo(Color.BLUE), 10);
* }</pre>
*
* @param animation The animation type to add
Expand All @@ -70,8 +73,8 @@ public AnimationBuilder add(Animation animation, double duration) {
* <pre>{@code
* // these animations will run at the same time
* obj.animate()
* .add(moveTo(100, 100), 100, TimeUnit.Frames)
* .add(colorTo(Color.BLUE), 100, TimeUnit.Frames);
* .add(Animation.moveTo(100, 100), 100, TimeUnit.Frames)
* .add(Animation.colorTo(Color.BLUE), 100, TimeUnit.Frames);
* }</pre>
*
* @param animation The animation type to add
Expand All @@ -96,8 +99,8 @@ public AnimationBuilder with(Animation animation, double duration, TimeUnit unit
* <pre>{@code
* // these animations will run at the same time
* obj.animate()
* .add(moveTo(100, 100), 10)
* .with(colorTo(Color.BLUE), 10);
* .add(Animation.moveTo(100, 100), 10)
* .with(Animation.colorTo(Color.BLUE), 10);
* }</pre>
*
* @param animation The animation type to add
Expand Down

0 comments on commit e389b58

Please sign in to comment.