|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.tile.Tile
public class Tile
A tile represents a single square in a single layer in a scene.
| Nested Class Summary | |
|---|---|
static class |
Tile.Key
Used when caching tiles. |
| Field Summary | |
|---|---|
protected Mirage |
_mirage
Our tileset image. |
protected static long |
_totalTileMemory
Used to track total (estimated) memory in use by tiles. |
Tile.Key |
key
The key associated with this tile. |
| Constructor Summary | |
|---|---|
Tile()
|
|
| Method Summary | |
|---|---|
protected void |
finalize()
Decrement total tile memory by our value. |
long |
getEstimatedMemoryUsage()
Returns the estimated memory usage of our underlying tile image. |
int |
getHeight()
Returns the height of this tile. |
int |
getWidth()
Returns the width of this tile. |
boolean |
hitTest(int x,
int y)
Returns true if the specified coordinates within this tile contains a non-transparent pixel. |
void |
paint(Graphics2D gfx,
int x,
int y)
Render the tile image at the specified position in the given graphics context. |
void |
setImage(Mirage image)
Configures this tile with its tile image. |
String |
toString()
|
protected void |
toString(StringBuilder buf)
This should be overridden by derived classes (which should be sure to call super.toString()) to append the derived class
specific tile information to the string buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Tile.Key key
protected Mirage _mirage
protected static long _totalTileMemory
| Constructor Detail |
|---|
public Tile()
| Method Detail |
|---|
public void setImage(Mirage image)
public int getWidth()
public int getHeight()
public long getEstimatedMemoryUsage()
public void paint(Graphics2D gfx,
int x,
int y)
public boolean hitTest(int x,
int y)
public String toString()
toString in class Objectprotected void toString(StringBuilder buf)
super.toString()) to append the derived class
specific tile information to the string buffer.
protected void finalize()
finalize in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||