Class SequenceGlider

java.lang.Object
com.github.yellowstonegames.smooth.Glider
com.github.yellowstonegames.smooth.SequenceGlider
Direct Known Subclasses:
VectorSequenceGlider

@Beta public class SequenceGlider extends Glider
Runs more than one Glider in a sequence. Each individual Glider will run one after the next, so it is likely that you will want to use a sequence of all the same type of Glider (that is, all can have their "x" or "color" coordinate queried and have it mean the same thing for any member of the sequence, for example).
  • Field Details

    • sequence

      protected Glider[] sequence
    • durations

      protected float[] durations
    • active

      protected int active
    • passed

      protected float passed
  • Constructor Details

    • SequenceGlider

      protected SequenceGlider()
    • SequenceGlider

      public SequenceGlider(Glider[] gliders, float[] lengths)
    • SequenceGlider

      public SequenceGlider(Glider[] gliders, float[] lengths, com.github.tommyettinger.digital.Interpolations.Interpolator interpolation, Runnable completeRunner)
  • Method Details

    • getFloat

      public float getFloat(String name)
      Description copied from class: Glider
      Gets the current float value for the Changer with the given name by interpolating between its start and end float values. The interpolation will be applied to change before it is passed to the Changer's Glider.Changer.interpolatorF. If this cannot locate a Changer by the given name, this returns Float.NaN.
      Overrides:
      getFloat in class Glider
      Parameters:
      name - the name of the Changer to look up
      Returns:
      the current float value of the located Changer, or Float.NaN if lookup fails
    • getInt

      public int getInt(String name)
      Description copied from class: Glider
      Gets the current int value for the Changer with the given name by interpolating between its start and end int values. The interpolation will be applied to change before it is passed to the Changer's Glider.Changer.interpolatorI. If this cannot locate a Changer by the given name, this returns Integer.MIN_VALUE.
      Overrides:
      getInt in class Glider
      Parameters:
      name - the name of the Changer to look up
      Returns:
      the current int value of the located Changer, or Integer.MIN_VALUE if lookup fails
    • getStartFloat

      public float getStartFloat(String name)
      Description copied from class: Glider
      Looks up the start float value for the Changer with the given name. If this cannot locate a Changer by the given name, this returns Float.NaN.
      Overrides:
      getStartFloat in class Glider
      Parameters:
      name - the name of the Changer to look up
      Returns:
      the start float value of the located Changer, or Float.NaN if lookup fails
    • setStartFloat

      public void setStartFloat(String name, float start)
      Description copied from class: Glider
      Sets the start float value for the Changer with the given name to start. If this cannot locate a Changer by the given name, this does nothing. Otherwise, sets the Changer's start float value and also sets Glider.change to 0.
      Overrides:
      setStartFloat in class Glider
      Parameters:
      name - the name of the Changer to look up
      start - value to use for the located Changer's start float
    • getEndFloat

      public float getEndFloat(String name)
      Description copied from class: Glider
      Looks up the end float value for the Changer with the given name. If this cannot locate a Changer by the given name, this returns Float.NaN.
      Overrides:
      getEndFloat in class Glider
      Parameters:
      name - the name of the Changer to look up
      Returns:
      the end float value of the located Changer, or Float.NaN if lookup fails
    • setEndFloat

      public void setEndFloat(String name, float end)
      Description copied from class: Glider
      Sets the end float value for the Changer with the given name to end. If this cannot locate a Changer by the given name, this does nothing. Otherwise, sets the Changer's end float value and also sets Glider.change to 0.
      Overrides:
      setEndFloat in class Glider
      Parameters:
      name - the name of the Changer to look up
      end - value to use for the located Changer's end float
    • getStartInt

      public int getStartInt(String name)
      Description copied from class: Glider
      Looks up the start int value for the Changer with the given name. If this cannot locate a Changer by the given name, this returns Integer.MIN_VALUE.
      Overrides:
      getStartInt in class Glider
      Parameters:
      name - the name of the Changer to look up
      Returns:
      the start int value of the located Changer, or Integer.MIN_VALUE if lookup fails
    • setStartInt

      public void setStartInt(String name, int start)
      Description copied from class: Glider
      Sets the start int value for the Changer with the given name to start. If this cannot locate a Changer by the given name, this does nothing. Otherwise, sets the Changer's start int value and also sets Glider.change to 0.
      Overrides:
      setStartInt in class Glider
      Parameters:
      name - the name of the Changer to look up
      start - value to use for the located Changer's start int
    • getEndInt

      public int getEndInt(String name)
      Description copied from class: Glider
      Looks up the end int value for the Changer with the given name. If this cannot locate a Changer by the given name, this returns Integer.MIN_VALUE.
      Overrides:
      getEndInt in class Glider
      Parameters:
      name - the name of the Changer to look up
      Returns:
      the end int value of the located Changer, or Integer.MIN_VALUE if lookup fails
    • setEndInt

      public void setEndInt(String name, int end)
      Description copied from class: Glider
      Sets the end int value for the Changer with the given name to end. If this cannot locate a Changer by the given name, this does nothing. Otherwise, sets the Changer's end int value and also sets Glider.change to 0.
      Overrides:
      setEndInt in class Glider
      Parameters:
      name - the name of the Changer to look up
      end - value to use for the located Changer's end int
    • setChange

      public void setChange(float change)
      Overrides:
      setChange in class Glider
    • getInterpolation

      public com.github.tommyettinger.digital.Interpolations.Interpolator getInterpolation()
      Overrides:
      getInterpolation in class Glider
    • setInterpolation

      public void setInterpolation(com.github.tommyettinger.digital.Interpolations.Interpolator interpolation)
      Overrides:
      setInterpolation in class Glider
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Glider
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Glider
    • toString

      public String toString()
      Overrides:
      toString in class Object