Class GlidingSprite

java.lang.Object
com.badlogic.gdx.graphics.g2d.TextureRegion
com.github.yellowstonegames.smooth.ParentSprite
com.github.yellowstonegames.smooth.GlidingSprite

public class GlidingSprite extends ParentSprite
Extends Sprite, using a normal TextureRegion its visuals and a CoordGlider to store its position. The CoordGlider is publicly available as location or with getLocation(), which should be used to determine or change where this started its move, where it is going, and how far it has gone between the two. You probably want to use a Texture with a width and height of 1 world unit, because by default this calls setSize(1, 1); in its constructor; this avoids the need to convert between Coord units in the CoordGlider and some other unit in the world.
  • Field Details

    • location

      public CoordGlider location
    • smallMotion

      public VectorSequenceGlider smallMotion
    • ownEmptyMotion

      public final VectorSequenceGlider ownEmptyMotion
      A VectorSequenceGlider that is empty (has no motions) and belongs to this AnimatedGlidingSprite. This is public so external code can use it, but should never be modified. It is here so smallMotion can be easily set to an empty sequence. You can also use setSmallMotion(null) to stop any small motion.
  • Constructor Details

    • GlidingSprite

      public GlidingSprite(com.badlogic.gdx.graphics.g2d.TextureRegion region)
    • GlidingSprite

      public GlidingSprite(com.badlogic.gdx.graphics.g2d.TextureRegion region, com.github.yellowstonegames.grid.Coord coord)
    • GlidingSprite

      public GlidingSprite(com.badlogic.gdx.graphics.g2d.TextureRegion region, com.github.yellowstonegames.grid.Coord start, com.github.yellowstonegames.grid.Coord end)
  • Method Details