Class ItemOpacityRenderer.OpacityTween

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.gui.ItemOpacityRenderer.OpacityTween
Enclosing class:
ItemOpacityRenderer

public static final class ItemOpacityRenderer.OpacityTween extends Object
An opacity eased from one value to another over a time, for an item fading in or out. Kept by whoever draws the item and read each frame (opacity()); it runs on the clock, so it carries on smoothly whatever the frame rate. Until started, it is at its first value.
  • Method Details

    • in

      public static ItemOpacityRenderer.OpacityTween in(int ticks)
      From unseen to fully shown over so many ticks, easing out.
    • out

      public static ItemOpacityRenderer.OpacityTween out(int ticks)
      From fully shown to unseen over so many ticks, easing in.
    • between

      public static ItemOpacityRenderer.OpacityTween between(float from, float to, int ticks, Easing easing)
      From one opacity to another over so many ticks, on an easing.
    • start

      Starts it now, from its first value (again, if it had run). Returns itself.
    • started

      public boolean started()
    • finished

      public boolean finished()
      Whether it has reached its last value.
    • opacity

      public float opacity()
      The opacity now, 0 to 1.