Class endstone::MapCanvas¶
ClassList > endstone > MapCanvas
Represents a canvas for drawing to a map. More...
#include <endstone/map/map_canvas.h>
Public Functions¶
| Type | Name |
|---|---|
| virtual void | drawImage (int x, int y, const Image & image) = 0 Draw an image to the map. The image will be clipped if necessary. |
| virtual std::uint32_t | getBasePixel (int x, int y) const = 0 Get a pixel from the layers below this canvas. |
| virtual Result< Color > | getBasePixelColor (int x, int y) const = 0 Get a pixel from the layers below this canvas. |
| virtual std::vector< MapCursor > | getCursors () const = 0 Get the cursors associated with this canvas. |
| virtual MapView & | getMapView () const = 0 Get the map this canvas is attached to. |
| virtual std::uint32_t | getPixel (int x, int y) const = 0 Get a pixel from the canvas. |
| virtual Result< Color > | getPixelColor (int x, int y) const = 0 Get a pixel from the canvas. |
| virtual void | setCursors (const std::vector< MapCursor > & cursors) = 0 Set the cursors associated with this canvas. |
| virtual void | setPixel (int x, int y, std::uint32_t color) = 0 Draw a pixel to the canvas. |
| virtual void | setPixelColor (int x, int y, Color color) = 0 Draw a pixel to the canvas. |
| virtual | ~MapCanvas () = default |
Detailed Description¶
Note:
Each canvas is associated with a specific MapRenderer and represents that renderer's layer on the map.
Public Functions Documentation¶
function drawImage¶
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.
function getBasePixel¶
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.
function getBasePixelColor¶
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
function getCursors¶
Get the cursors associated with this canvas.
Returns:
The MapCursorCollection associated with this canvas.
function getMapView¶
Get the map this canvas is attached to.
Returns:
The MapView this canvas is attached to.
function getPixel¶
Get a pixel from the canvas.
Parameters:
xThe x coordinate, from 0 to 127.yThe y coordinate, from 0 to 127.
Returns:
The color.
function getPixelColor¶
Get a pixel from the canvas.
Parameters:
xThe x coordinate, from 0 to 127.yThe y coordinate, from 0 to 127.
Returns:
The color
function setCursors¶
Set the cursors associated with this canvas.
Parameters:
cursorsThe MapCursorCollection to associate with this canvas.
function setPixel¶
Draw a pixel to the canvas.
Parameters:
xThe x coordinate, from 0 to 127.yThe y coordinate, from 0 to 127.colorThe color.
function setPixelColor¶
Draw a pixel to the canvas.
Parameters:
xThe x coordinate, from 0 to 127.yThe y coordinate, from 0 to 127.colorThe color
function ~MapCanvas¶
The documentation for this class was generated from the following file include/endstone/map/map_canvas.h