Package games.stendhal.client.sprite
Class EmptySprite
java.lang.Object
games.stendhal.client.sprite.EmptySprite
- All Implemented Interfaces:
Sprite
An empty (non-drawing) sprite.
-
Constructor Summary
ConstructorDescriptionEmptySprite(int width, int height, Object reference)
Create an empty sprite. -
Method Summary
Modifier and TypeMethodDescriptioncreateRegion(int x, int y, int width, int height, Object ref)
Create a sub-region of this sprite.void
Draw the sprite onto the graphics context provided.void
Draws the image.int
Get the height of the drawn sprite.Get the sprite reference.int
getWidth()
Get the width of the drawn sprite.boolean
Check whether the sprite won't change between draws.
-
Constructor Details
-
EmptySprite
Create an empty sprite.- Parameters:
width
- The sprite width.height
- The sprite height.reference
-
-
-
Method Details
-
createRegion
Create a sub-region of this sprite. NOTE: This does not use caching.- Specified by:
createRegion
in interfaceSprite
- Parameters:
x
- The starting X coordinate.y
- The starting Y coordinate.width
- The region width.height
- The region height.ref
- The sprite reference.- Returns:
- A new sprite.
-
draw
Draw the sprite onto the graphics context provided. -
draw
Draws the image. -
getHeight
public int getHeight()Get the height of the drawn sprite. -
getReference
Get the sprite reference. This identifier is an externally opaque object that implements equals() and hashCode() to uniquely/repeatably reference a keyed sprite.- Specified by:
getReference
in interfaceSprite
- Returns:
- The reference identifier, or
null
if not referencable.
-
getWidth
public int getWidth()Get the width of the drawn sprite. -
isConstant
public boolean isConstant()Description copied from interface:Sprite
Check whether the sprite won't change between draws.- Specified by:
isConstant
in interfaceSprite
- Returns:
true
if different draws of the sprite always have the same result.
-