接口 MapCanvas
地图渲染器并表现为地图上渲染器的一层.- 
方法概要修饰符和类型方法说明void画一张图片到地图上,如果必要的话,图像将被裁剪.void使用你想要的格式渲染文字到地图上.换行符(\n)会移动到下一行并返回原来的列, 字体颜色可以使用带字符的数字来改变如"§12;",这会把字体颜色换为颜色表中 第12个颜色(参考MapPalette).bytegetBasePixel(int x, int y) 已过时。getBasePixelColor(int x, int y) Get a pixel from the layers below this canvas.获取与该画布相关联的游标集合.获取画布依附的地图.bytegetPixel(int x, int y) 已过时。魔法值, 请使用getPixelColor(int, int)getPixelColor(int x, int y) Get a pixel from the canvas.voidsetCursors(@NotNull MapCursorCollection cursors) 设置与该画布相关联的游标集合,自从地图游标集合(MapCursorCollection)提供后这个方法通常不需要被调用.voidsetPixel(int x, int y, byte color) 已过时。魔法值, 请使用setPixelColor(int, int, Color)voidsetPixelColor(int x, int y, @Nullable Color color) Draw a pixel to the canvas.
- 
方法详细资料- 
getMapView获取画布依附的地图.原文:Get the map this canvas is attached to. - 返回:
- 画布依附的地图控件
 
- 
getCursors获取与该画布相关联的游标集合.原文:Get the cursor collection associated with this canvas. - 返回:
- 与该画布相关联的游标集合
 
- 
setCursors设置与该画布相关联的游标集合,自从地图游标集合(MapCursorCollection)提供后这个方法通常不需要被调用.原文:Set the cursor collection associated with this canvas. This does not usually need to be called since a MapCursorCollection is already provided. - 参数:
- cursors- 与画布相关联的游标集合
 
- 
setPixelColorDraw a pixel to the canvas.The provided color might be converted to another color, which is in the map color range. This means, that getPixelColor(int, int)might return another color than set. If null is used as color, then the color returned bygetBasePixelColor(int, int)is shown on the map.- 参数:
- x- The x coordinate, from 0 to 127.
- y- The y coordinate, from 0 to 127.
- color- The color.
 
- 
getPixelColorGet a pixel from the canvas. If no color is set at the given position for this canvas, then null is returned and the color returned bygetBasePixelColor(int, int)is shown on the map.- 参数:
- x- The x coordinate, from 0 to 127.
- y- The y coordinate, from 0 to 127.
- 返回:
- The color, or null if no color is set.
 
- 
getBasePixelColorGet a pixel from the layers below this canvas.- 参数:
- x- The x coordinate, from 0 to 127.
- y- The y coordinate, from 0 to 127.
- 返回:
- The color.
 
- 
setPixel已过时。魔法值, 请使用setPixelColor(int, int, Color)画一个像素到画布上.原文:Draw a pixel to the canvas. - 参数:
- x- x坐标值,从0到127
- y- y坐标值,从0到127
- color- 颜色,参考- MapPalette
 
- 
getPixel已过时。魔法值, 请使用getPixelColor(int, int)获取画布上的一个像素.原文:Get a pixel from the canvas. - 参数:
- x- x坐标值,从0到127
- y- y坐标值,从0到127
- 返回:
- 颜色. 参阅 MapPalette.
 
- 
getBasePixel已过时。魔法值, 请使用getBasePixelColor(int, int)获取画布下层的一个像素.原文:Get a pixel from the layers below this canvas. - 参数:
- x- x坐标值,从0到127
- y- y坐标值,从0到127
- 返回:
- 颜色. 参阅 MapPalette.
 
- 
drawImage画一张图片到地图上,如果必要的话,图像将被裁剪.原文:Draw an image to the map. The image will be clipped if necessary. - 参数:
- x- 图片的x坐标
- y- 图片的y坐标
- image- 要画的图片
 
- 
drawText使用你想要的格式渲染文字到地图上.换行符(\n)会移动到下一行并返回原来的列, 字体颜色可以使用带字符的数字来改变如"§12;",这会把字体颜色换为颜色表中 第12个颜色(参考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- 要渲染的格式化文字
 
 
- 
getBasePixelColor(int, int)