Class CoordGlider
java.lang.Object
com.github.yellowstonegames.smooth.Glider
com.github.yellowstonegames.smooth.CoordGlider
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
This is a type of Glider, and so is compatible with other Gliders (it can also be merged with them).
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).
-
Nested Class Summary
Nested classes/interfaces inherited from class Glider
Glider.Changer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.github.yellowstonegames.grid.Coordprotected com.github.yellowstonegames.grid.CoordFields inherited from class Glider
change, changers, completeRunner, interpolation -
Constructor Summary
ConstructorsConstructorDescriptionCoordGlider(com.github.tommyettinger.digital.Interpolations.Interpolator interpolation, Runnable completeRunner, com.github.yellowstonegames.grid.Coord start, com.github.yellowstonegames.grid.Coord end) CoordGlider(com.github.yellowstonegames.grid.Coord start) CoordGlider(com.github.yellowstonegames.grid.Coord start, com.github.yellowstonegames.grid.Coord end) CoordGlider(CoordGlider other) -
Method Summary
Methods inherited from class Glider
addChanger, addChangers, addChangers, equals, getChange, getCompleteRunner, getEndFloat, getEndInt, getFloat, getInt, getInterpolation, getStartFloat, getStartInt, hashCode, merge, removeChanger, resetToCurrent, setChange, setCompleteRunner, setEndFloat, setEndInt, setInterpolation, setStartFloat, setStartInt
-
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
-
-
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:
onCompletein classGlider
-