public interface MapCanvas
地图渲染器
并表现为地图上渲染器的一层.限定符和类型 | 方法和说明 |
---|---|
void |
drawImage(int x,
int y,
java.awt.Image image)
画一张图片到地图上,如果必要的话,图像将被裁剪.
|
void |
drawText(int x,
int y,
MapFont font,
java.lang.String text)
使用你想要的格式渲染文字到地图上.换行符(\n)会移动到下一行并返回原来的列,
字体颜色可以使用带字符的数字来改变如"§12;",这会把字体颜色换为颜色表中
第12个颜色(参考
MapPalette ). |
byte |
getBasePixel(int x,
int y)
获取画布下层的一个像素.
|
MapCursorCollection |
getCursors()
获取与该画布相关联的游标集合.
|
MapView |
getMapView()
获取画布依附的地图.
|
byte |
getPixel(int x,
int y)
获取画布上的一个像素.
|
void |
setCursors(MapCursorCollection cursors)
设置与该画布相关联的游标集合,自从地图游标集合(MapCursorCollection)提供后这个方法通常不需要被调用.
|
void |
setPixel(int x,
int y,
byte color)
画一个像素到画布上.
|
MapView getMapView()
原文:Get the map this canvas is attached to.
MapCursorCollection getCursors()
原文:Get the cursor collection associated with this canvas.
void setCursors(MapCursorCollection cursors)
原文:Set the cursor collection associated with this canvas. This does not usually need to be called since a MapCursorCollection is already provided.
cursors
- 与画布相关联的游标集合void setPixel(int x, int y, byte color)
原文:Draw a pixel to the canvas.
x
- x坐标值,从0到127y
- y坐标值,从0到127color
- 颜色,参考MapPalette
byte getPixel(int x, int y)
原文:Get a pixel from the canvas.
x
- x坐标值,从0到127y
- y坐标值,从0到127MapPalette
.byte getBasePixel(int x, int y)
原文:Get a pixel from the layers below this canvas.
x
- x坐标值,从0到127y
- y坐标值,从0到127MapPalette
.void drawImage(int x, int y, java.awt.Image image)
原文:Draw an image to the map. The image will be clipped if necessary.
x
- 图片的x坐标y
- 图片的x坐标image
- 要画的图片void drawText(int x, int y, MapFont font, java.lang.String text)
MapPalette
).
原文:Render text to the map using fancy formatting. Newline (\n) characters
will move down one line and return to the original column, and the text
color can be changed using sequences such as "§12;", replacing 12 with
the palette index of the color (see MapPalette
).
x
- 开始渲染的列y
- 开始渲染的行font
- 使用的字体text
- 要渲染的格式化文字