Package playn.core

Class Tile

Direct Known Subclasses:
Texture

public abstract class Tile extends TileSource
Represents a square region of a texture. This makes it easy to render tiles from texture atlases.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    abstract float
    The height of this tile (in display units).
    boolean
    Returns whether this tile source is loaded and ready to provide its tile.
    abstract float
    sx()
    Returns the s texture coordinate for the x-axis.
    abstract float
    sy()
    Returns the s texture coordinate for the y-axis.
    abstract Texture
    The texture which contains this tile.
    Returns the tile provided by this source.
    Delivers the tile provided by this source once the source is loaded.
     
    abstract float
    tx()
    Returns the t texture coordinate for the x-axis.
    abstract float
    ty()
    Returns the t texture coordinate for the y-axis.
    abstract float
    The width of this tile (in display units).

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Tile

      public Tile()
  • Method Details

    • texture

      public abstract Texture 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 the s texture coordinate for the x-axis.
    • sy

      public abstract float sy()
      Returns the s texture coordinate for the y-axis.
    • tx

      public abstract float tx()
      Returns the t texture coordinate for the x-axis.
    • ty

      public abstract float ty()
      Returns the t texture 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: TileSource
      Returns whether this tile source is loaded and ready to provide its tile.
      Specified by:
      isLoaded in class TileSource
    • tile

      public Tile tile()
      Description copied from class: TileSource
      Returns the tile provided by this source.
      Specified by:
      tile in class TileSource
    • tileAsync

      public RFuture<Tile> tileAsync()
      Description copied from class: TileSource
      Delivers the tile provided by this source once the source is loaded.
      Specified by:
      tileAsync in class TileSource
    • toString

      public String toString()
      Overrides:
      toString in class Object