Class CoordGlider

java.lang.Object
com.github.yellowstonegames.smooth.Glider
com.github.yellowstonegames.smooth.CoordGlider

public class CoordGlider extends Glider
Allows specifying a smoothly-changing float position using an exact Coord for the start and the end, with a change amount that affects how far a position has moved from start to end. Typical usage sets the start with setStart(Coord) once and the end more than once with setEnd(Coord), changing the end each time the move is complete. The x and y positions are automatically calculated in getX() and getY(), and their values will be different every time Glider.setChange(float) is called with a different amount. You can optionally use an Interpolations.Interpolator to make the rate of change different.
This is a type of Glider, and so is compatible with other Gliders (it can also be merged with them).
  • Field Details

    • start

      protected com.github.yellowstonegames.grid.Coord start
    • end

      protected com.github.yellowstonegames.grid.Coord end
  • Constructor Details

    • CoordGlider

      public CoordGlider()
    • CoordGlider

      public CoordGlider(com.github.yellowstonegames.grid.Coord start)
    • CoordGlider

      public CoordGlider(com.github.yellowstonegames.grid.Coord start, com.github.yellowstonegames.grid.Coord end)
    • CoordGlider

      public CoordGlider(com.github.tommyettinger.digital.Interpolations.Interpolator interpolation, Runnable completeRunner, com.github.yellowstonegames.grid.Coord start, com.github.yellowstonegames.grid.Coord end)
    • CoordGlider

      public CoordGlider(CoordGlider other)
  • Method Details

    • getX

      public float getX()
    • getY

      public float getY()
    • getStart

      public com.github.yellowstonegames.grid.Coord getStart()
    • setStart

      public void setStart(com.github.yellowstonegames.grid.Coord start)
    • getEnd

      public com.github.yellowstonegames.grid.Coord getEnd()
    • setEnd

      public void setEnd(com.github.yellowstonegames.grid.Coord end)
    • onComplete

      public void onComplete()
      Overrides:
      onComplete in class Glider