Package games.stendhal.client.sprite
Class SequenceSprite
java.lang.Object
games.stendhal.client.sprite.AnimatedSprite
games.stendhal.client.sprite.SequenceSprite
- All Implemented Interfaces:
Sprite
An animated sprite that draw the frames once, and then signals the attached
listener.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface for objects that receive notifications at the end of the sprite sequence. -
Field Summary
Fields inherited from class games.stendhal.client.sprite.AnimatedSprite
delays, frames, lastUpdate, loop, sprite
-
Constructor Summary
ConstructorDescriptionSequenceSprite(SequenceSprite.SequenceSpriteListener listener, Sprite[] frames, int delay)
Create a new SequenceSprite with constant delay between the frames. -
Method Summary
Methods inherited from class games.stendhal.client.sprite.AnimatedSprite
createRegion, draw, getHeight, getReference, getWidth, reset, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface games.stendhal.client.sprite.Sprite
isConstant
-
Constructor Details
-
SequenceSprite
Create a new SequenceSprite with constant delay between the frames.- Parameters:
listener
- listener that gets notified when drawing the sprite sequence has finishedframes
- animation framesdelay
- delay between frames in milliseconds
-
-
Method Details
-
draw
Description copied from class:AnimatedSprite
Draw the sprite onto the graphics context provided.- Specified by:
draw
in interfaceSprite
- Overrides:
draw
in classAnimatedSprite
- Parameters:
g
- The graphics context on which to draw the spritex
- The x location at which to draw the spritey
- The y location at which to draw the sprite
-