|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.tiled.Layer
public class Layer
A layer of tiles on the map
Field Summary | |
---|---|
int[][][] |
data
The tile data representing this data, index 0 = tileset, index 1 = tile id |
int |
height
The height of this layer |
int |
index
The index of this layer |
java.lang.String |
name
The name of this layer - read from the XML |
java.util.Properties |
props
the properties of this layer |
int |
width
The width of this layer |
Constructor Summary | |
---|---|
Layer(TiledMap map,
org.w3c.dom.Element element)
Create a new layer based on the XML definition |
Method Summary | |
---|---|
int |
getTileID(int x,
int y)
Get the gloal ID of the tile at the specified location in this layer |
void |
render(int x,
int y,
int sx,
int sy,
int width,
int ty,
boolean lineByLine,
int mapTileWidth,
int mapTileHeight)
Render a section of this layer |
void |
setTileID(int x,
int y,
int tile)
Set the global tile ID at a specified location |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int index
public java.lang.String name
public int[][][] data
public int width
public int height
public java.util.Properties props
Constructor Detail |
---|
public Layer(TiledMap map, org.w3c.dom.Element element) throws SlickException
element
- The XML element describing the layermap
- The map this layer is part of
SlickException
- Indicates a failure to parse the XML layerMethod Detail |
---|
public int getTileID(int x, int y)
x
- The x coorindate of the tiley
- The y coorindate of the tile
public void setTileID(int x, int y, int tile)
x
- The x location to sety
- The y location to settile
- The tile value to setpublic void render(int x, int y, int sx, int sy, int width, int ty, boolean lineByLine, int mapTileWidth, int mapTileHeight)
x
- The x location to render aty
- The y location to render atsx
- The x tile location to start renderingsy
- The y tile location to start renderingwidth
- The number of tiles across to renderty
- The line of tiles to renderlineByLine
- True if we should render line by line, i.e. giving us a chance
to render something else between linesmapTileWidth
- the tile width specified in the map filemapTileHeight
- the tile height specified in the map file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |