|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrlgamekit.map.display.AbstractTilePainter
rlgamekit.map.display.GraphicsTilePainter
public class GraphicsTilePainter
Paint a graphical tile for a map cell at a specified screen location. Tile sheets must be organized with 8 tiles a row currently.
| Field Summary |
|---|
| Fields inherited from class rlgamekit.map.display.AbstractTilePainter |
|---|
viewHeight, viewMap, viewWidth |
| Fields inherited from interface rlgamekit.map.display.TilePainter |
|---|
VIEW_REMEMBERED, VIEW_VISIBLE |
| Constructor Summary | |
|---|---|
GraphicsTilePainter()
|
|
| Method Summary | |
|---|---|
int[] |
getLetterHeights()
|
int[] |
getLetterWidths()
|
void |
paint(java.awt.Graphics gr,
int xpos,
int ypos,
int color,
int tileNo)
Paint a tile from the tile sheet at the given location. |
void |
paint(java.awt.Graphics gr,
int layer,
int mapX,
int mapY,
int xpos,
int ypos,
int tileNo)
Paint a map element. |
void |
setLetterOffset(int x,
int y)
Applies a global offset to all painted letters. |
protected void |
setRGB(int[] rgb)
If you need a custom color map for your tile sheet, you can subclass the GraphicsTilePainter and supply your color map through this method. make sure to call this before you call stTileSheet() |
void |
setTileSheet(java.awt.image.BufferedImage tilesheet,
int rasterX,
int rasterY)
Set the tiles to be used for drawing. |
| Methods inherited from class rlgamekit.map.display.AbstractTilePainter |
|---|
setViewMap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraphicsTilePainter()
| Method Detail |
|---|
protected void setRGB(int[] rgb)
setTileSheetpublic int[] getLetterWidths()
public int[] getLetterHeights()
public void setLetterOffset(int x,
int y)
x - x offsety - y offset
public void setTileSheet(java.awt.image.BufferedImage tilesheet,
int rasterX,
int rasterY)
tilesheet - The font to use.rasterX - x raster size if the tile sheetrasterY - y raster size if the tile sheet
public void paint(java.awt.Graphics gr,
int layer,
int mapX,
int mapY,
int xpos,
int ypos,
int tileNo)
TilePainter
gr - The graphics context to paint onto.layer - The map layermapX - The map x coordinatemapY - The map y coordinatexpos - The screen x position to draw toypos - The screen y position to draw totileNo - The tile number to draw
public void paint(java.awt.Graphics gr,
int xpos,
int ypos,
int color,
int tileNo)
gr - Graphics context to use for paintingxpos - x position to paint the tileypos - y position to paint the tilecolor - color of the tile (use 0 if you want the original colors)tileNo - no. of the tile to paint.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||