Class Sprite
java.lang.Object
model.Sprite
A sprite that is used by an Entity as the Entities visual
representation (ie what you see on the screen). Note that a sprite
contains no state information, i.e. its just the image and
not the location. This allows us to use a single sprite in
lots of different places without having to store multiple
copies of the image.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Sprite
-
-
Method Details
-
getWidth
public int getWidth()Get the width of the drawn sprite- Returns:
- The width in pixels of this sprite
-
getHeight
public int getHeight()Get the height of the drawn sprite- Returns:
- The height in pixels of this sprite
-
draw
Draw the sprite onto the graphics context provided- 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
-
getRef
-
toString
-
equals
-
hashCode
-