Added easing functions for all-around better animations.

These are Robert Penner's easing functions (http://robertpenner.com/easing/), refactored by CharlotteGore to only take a t parameter (https://github.com/CharlotteGore/functional-easing). Licensed under BSD (the former) and MIT (the latter).

Related changes:
- Added "AnimatedValue" utility class for updating values used in animations.
- MenuButton now uses AnimatedValue to handle its animations (still linear by default).
- Added in-out-back easings on logo, mods, and various other elements; added out-bounce easings on button menu.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-08-05 22:28:14 -05:00
parent 6a4c6a8d37
commit c91146b024
10 changed files with 588 additions and 78 deletions

View File

@@ -19,6 +19,7 @@
package itdelatrisu.opsu;
import itdelatrisu.opsu.ui.MenuButton;
import itdelatrisu.opsu.ui.animations.AnimationEquation;
import java.util.Arrays;
import java.util.Collections;
@@ -199,6 +200,8 @@ public enum GameMod {
mod.button = new MenuButton(img,
baseX + (offsetX * mod.categoryIndex) + img.getWidth() / 2f,
mod.category.getY());
mod.button.setHoverAnimationDuration(300);
mod.button.setHoverAnimationEquation(AnimationEquation.IN_OUT_BACK);
mod.button.setHoverExpand(1.2f);
mod.button.setHoverRotate(10f);