| Modifier and Type | Field and Description |
|---|---|
| private int | height
The height in pixels of this sprite |
| private Texture | texture
The texture that stores the image for this sprite |
| private int | width
The width in pixels of this sprite |
| Access | Constructor and Description |
|---|---|
| public | Sprite(TextureLoader
the texture loader to use loader, String A reference to the image on which this sprite should be based ref)Create a new sprite from a specified image. |
| Modifier and Type | Method and Description |
|---|---|
| public void | draw(int
The x location at which to draw this sprite x, int The y location at which to draw this sprite y)Draw the sprite at the specified location |
| public int | |
| public int |
| height | back to summary |
|---|---|
| private int height The height in pixels of this sprite | |
| texture | back to summary |
|---|---|
| private Texture texture The texture that stores the image for this sprite | |
| width | back to summary |
|---|---|
| private int width The width in pixels of this sprite | |
| Sprite | back to summary |
|---|---|
| public Sprite(TextureLoader loader, String ref) Create a new sprite from a specified image.
| |
| draw | back to summary |
|---|---|
| public void draw(int x, int y) Draw the sprite at the specified location
| |
| getHeight | back to summary |
|---|---|
| public int getHeight() Get the height of this sprite in pixels
| |
| getWidth | back to summary |
|---|---|
| public int getWidth() Get the width of this sprite in pixels
| |