|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.tile.Tile
com.threerings.media.tile.TrimmedTile
public class TrimmedTile
Behaves just like a regular tile, but contains a "trimmed" image which is one where the source image has been trimmed to the smallest rectangle that contains all the non-transparent pixels of the original image.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.tile.Tile |
|---|
Tile.Key |
| Field Summary | |
|---|---|
protected Rectangle |
_tbounds
Our extra trimmed image dimension information. |
| Fields inherited from class com.threerings.media.tile.Tile |
|---|
_mirage, _totalTileMemory, key |
| Constructor Summary | |
|---|---|
TrimmedTile()
|
|
| Method Summary | |
|---|---|
int |
getHeight()
Returns the height of this tile. |
void |
getTrimmedBounds(Rectangle tbounds)
Fills in the bounds of the trimmed image within the coordinate system defined by the complete virtual 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 |
setTrimmedBounds(Rectangle tbounds)
Sets the trimmed bounds of this tile. |
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 com.threerings.media.tile.Tile |
|---|
finalize, getEstimatedMemoryUsage, setImage, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Rectangle _tbounds
| Constructor Detail |
|---|
public TrimmedTile()
| Method Detail |
|---|
public void setTrimmedBounds(Rectangle tbounds)
tbounds - contains the width and height of the untrimmed tile, but the x and y
offset of the trimmed tile image in the original untrimmed tile image.public int getWidth()
Tile
getWidth in class Tilepublic int getHeight()
Tile
getHeight in class Tile
public void paint(Graphics2D gfx,
int x,
int y)
Tile
paint in class Tilepublic void getTrimmedBounds(Rectangle tbounds)
public boolean hitTest(int x,
int y)
Tile
hitTest in class Tileprotected void toString(StringBuilder buf)
Tilesuper.toString()) to append the derived class
specific tile information to the string buffer.
toString in class Tile
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||