Package playn.core
Class Tile
java.lang.Object
playn.core.TileSource
playn.core.Tile
- Direct Known Subclasses:
Texture
Represents a square region of a texture. This makes it easy to render tiles from texture
atlases.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddToBatch(QuadBatch batch, int tint, AffineTransform tx, float x, float y, float width, float height) Adds this tile to the supplied quad batch.abstract voidaddToBatch(QuadBatch batch, int tint, AffineTransform tx, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) Adds this tile to the supplied quad batch.abstract floatheight()The height of this tile (in display units).booleanisLoaded()Returns whether this tile source is loaded and ready to provide its tile.abstract floatsx()Returns thestexture coordinate for the x-axis.abstract floatsy()Returns thestexture coordinate for the y-axis.abstract Texturetexture()The texture which contains this tile.tile()Returns the tile provided by this source.Delivers the tile provided by this source once the source is loaded.toString()abstract floattx()Returns thettexture coordinate for the x-axis.abstract floatty()Returns thettexture coordinate for the y-axis.abstract floatwidth()The width of this tile (in display units).
-
Constructor Details
-
Tile
public Tile()
-
-
Method Details
-
texture
The texture which contains this tile. -
width
public abstract float width()The width of this tile (in display units). -
height
public abstract float height()The height of this tile (in display units). -
sx
public abstract float sx()Returns thestexture coordinate for the x-axis. -
sy
public abstract float sy()Returns thestexture coordinate for the y-axis. -
tx
public abstract float tx()Returns thettexture coordinate for the x-axis. -
ty
public abstract float ty()Returns thettexture coordinate for the y-axis. -
addToBatch
public abstract void addToBatch(QuadBatch batch, int tint, AffineTransform tx, float x, float y, float width, float height) Adds this tile to the supplied quad batch. -
addToBatch
public abstract void addToBatch(QuadBatch batch, int tint, AffineTransform tx, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh) Adds this tile to the supplied quad batch. -
isLoaded
public boolean isLoaded()Description copied from class:TileSourceReturns whether this tile source is loaded and ready to provide its tile.- Specified by:
isLoadedin classTileSource
-
tile
Description copied from class:TileSourceReturns the tile provided by this source.- Specified by:
tilein classTileSource
-
tileAsync
Description copied from class:TileSourceDelivers the tile provided by this source once the source is loaded.- Specified by:
tileAsyncin classTileSource
-
toString
-