public class Texture
extends java.lang.Object
Sprite
or a Tile.
Texture objects are typically created using the load(String) method.
Multiple instances of a Sprite may share a single Texture reference.| Modifier and Type | Field and Description |
|---|---|
javafx.scene.image.Image |
image
The image to be drawn.
|
Rectangle |
region
A rectangular sub-area of the image to be drawn.
|
| Constructor and Description |
|---|
Texture()
Create an empty texture.
|
| Modifier and Type | Method and Description |
|---|---|
static Texture |
load(java.lang.String imageFileName)
Create a Texture from the image file with the given file name.
|
public javafx.scene.image.Image image
public Rectangle region
public static Texture load(java.lang.String imageFileName)
region to the original image dimensions.imageFileName - name of the image file