Package org.xjge.graphics
Class Instance2D
java.lang.Object
org.xjge.graphics.Instance2D
public class Instance2D
extends java.lang.Object
Defines a set of reusable vertex data that can be utilized to represent a 2D
object that makes use of instanced rendering techniques.
- Since:
- 2.0.0
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Instance2D(Texture texture, int cellWidth, int cellHeight, boolean fromCenter)
Constructs a rectangular instance that uses a sprite image as its texture. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
vao
public final int vao -
cellWidth
public final int cellWidth -
cellHeight
public final int cellHeight -
texture
-
atlas
-
-
Constructor Details
-
Instance2D
Constructs a rectangular instance that uses a sprite image as its texture. Useful for text, tiles, etc.- Parameters:
texture
- the texture image to usecellWidth
- the width of each sub-image cell in pixelscellHeight
- the height of each sub-image cell in pixelsfromCenter
- determines whether the instance will be offset by its center or bottom left corner relative to its position
-