Skip to content

Commit

Permalink
Add shortcut to remove Tween instances from the TweenEngine.
Browse files Browse the repository at this point in the history
  • Loading branch information
nightm4re94 committed Jan 3, 2021
1 parent 947b749 commit 5c83332
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/de/gurkenlabs/litiengine/tweening/TweenEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ public void start() {
Game.loop().attach(this);
}

/**
* Looks for a registered Tween instance with the given target and type. Attempts to remove the Tween from the TweenEngine.
*
* @param target the {@code Tweenable} target object
* @param type the {@code TweenType} determining which values of the target object will be modified.
*/
public void remove(final Tweenable target, final TweenType type) {
final Tween tween = this.getTween(target, type);
if (tween != null) {
this.getTweens().get(target).remove(type);
}
}

/**
* Looks for a registered Tween instance with the given target and type. Attempts to stop the Tween.
*
Expand Down

0 comments on commit 5c83332

Please sign in to comment.