Package graphics
Class Sprite
java.lang.Object
graphics.Sprite
- Direct Known Subclasses:
Glyph
Contains the texture and UV coordinates used by openGL to render an image
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Get the height of the textureGet this sprite's textureorg.joml.Vector2f[]
Get this sprite's texture coordinatesint
Get the texture id of this spritefloat
getWidth()
Get the width of the texturevoid
setTexture
(Texture texture) Set this sprite's texture
-
Field Details
-
texture
The texture for this sprite
-
-
Constructor Details
-
Sprite
Construct a Sprite using custom texture coordinates (uv).- Parameters:
texture
- The texture for this spriteuv
- The sprite's texture coords
-
Sprite
Construct a texture using default texture coordinates.- Parameters:
texture
- The texture for this sprite
-
-
Method Details
-
getTexture
Get this sprite's texture -
setTexture
Set this sprite's texture -
getTextureCoordinates
public org.joml.Vector2f[] getTextureCoordinates()Get this sprite's texture coordinates -
getTextureID
public int getTextureID()Get the texture id of this sprite -
getWidth
public float getWidth()Get the width of the texture -
getHeight
public float getHeight()Get the height of the texture
-