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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface 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
ConstructorsConstructorDescriptionSequenceSprite(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, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:AnimatedSpriteDraw the sprite onto the graphics context provided.- Specified by:
drawin interfaceSprite- Overrides:
drawin 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
-