Class SequenceSprite

java.lang.Object
games.stendhal.client.sprite.AnimatedSprite
games.stendhal.client.sprite.SequenceSprite
All Implemented Interfaces:
Sprite

public class SequenceSprite extends AnimatedSprite
An animated sprite that draw the frames once, and then signals the attached listener.
  • Constructor Details

    • SequenceSprite

      public SequenceSprite(SequenceSprite.SequenceSpriteListener listener, Sprite[] frames, int delay)
      Create a new SequenceSprite with constant delay between the frames.
      Parameters:
      listener - listener that gets notified when drawing the sprite sequence has finished
      frames - animation frames
      delay - delay between frames in milliseconds
  • Method Details

    • draw

      public void draw(Graphics g, int x, int y)
      Description copied from class: AnimatedSprite
      Draw the sprite onto the graphics context provided.
      Specified by:
      draw in interface Sprite
      Overrides:
      draw in class AnimatedSprite
      Parameters:
      g - The graphics context on which to draw the sprite
      x - The x location at which to draw the sprite
      y - The y location at which to draw the sprite