Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.map.MapCanvas Interface Reference

Public Member Functions

MapView getMapView ()
 
MapCursorCollection getCursors ()
 
void setCursors (MapCursorCollection cursors)
 
void setPixel (int x, int y, byte color)
 
byte getPixel (int x, int y)
 
byte getBasePixel (int x, int y)
 
void drawImage (int x, int y, Image image)
 
void drawText (int x, int y, MapFont font, String text)
 

Detailed Description

Represents a canvas for drawing to a map. Each canvas is associated with a specific MapRenderer and represents that renderer's layer on the map.

Definition at line 10 of file MapCanvas.java.

Member Function Documentation

void org.bukkit.map.MapCanvas.drawImage ( int  x,
int  y,
Image  image 
)

Draw an image to the map. The image will be clipped if necessary.

Parameters
xThe x coordinate of the image.
yThe y coordinate of the image.
imageThe Image to draw.
void org.bukkit.map.MapCanvas.drawText ( int  x,
int  y,
MapFont  font,
String  text 
)

Render text to the map using fancy formatting. Newline (
) 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).

Parameters
xThe column to start rendering on.
yThe row to start rendering on.
fontThe font to use.
textThe formatted text to render.
byte org.bukkit.map.MapCanvas.getBasePixel ( int  x,
int  y 
)

Get a pixel from the layers below this canvas.

Parameters
xThe x coordinate, from 0 to 127.
yThe y coordinate, from 0 to 127.
Returns
The color. See MapPalette.
MapCursorCollection org.bukkit.map.MapCanvas.getCursors ( )

Get the cursor collection associated with this canvas.

Returns
The MapCursorCollection associated with this canvas.
MapView org.bukkit.map.MapCanvas.getMapView ( )

Get the map this canvas is attached to.

Returns
The MapView this canvas is attached to.
byte org.bukkit.map.MapCanvas.getPixel ( int  x,
int  y 
)

Get a pixel from the canvas.

Parameters
xThe x coordinate, from 0 to 127.
yThe y coordinate, from 0 to 127.
Returns
The color. See MapPalette.
void org.bukkit.map.MapCanvas.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.

Parameters
cursorsThe MapCursorCollection to associate with this canvas.
void org.bukkit.map.MapCanvas.setPixel ( int  x,
int  y,
byte  color 
)

Draw a pixel to the canvas.

Parameters
xThe x coordinate, from 0 to 127.
yThe y coordinate, from 0 to 127.
colorThe color. See MapPalette.

The documentation for this interface was generated from the following file: