Interface Canvas
access this type via: ui.Canvas (provides, requires or uses)
Canvas defines a fundamental drawing API, typically used by a Window and offered as a painting surface to any objects on the window.
Functions
void point(Point2D point)
void line(Line2D line, optional int lineWidth)
void curve(Curve2D line, int isteps, optional int lineWidth)
void rect(Rect2D rect)
void rectOutline(Rect2D rect, optional int lineWidth)
void roundedRect(Rect2D rect, int xRadius, int yRadius)
void roundedRectOutline(Rect2D rect, int xRadius, int yRadius, optional int lineWidth)
void ellipse(Ellipse2D ellipse)
void ellipseOutline(Ellipse2D ellipse, optional int lineWidth)
void arc(Arc2D ellipse)
void arcOutline(Arc2D ellipse, optional int lineWidth)
void pie(Arc2D ellipse)
void polygon(Polygon2D p)
void polygonOutline(Polygon2D p)
void polygonBezier(Polygon2D p, int isteps)
void pixels(PixelMap map, int x, int y, optional int scaledWidth, int scaledHeight, int rotation, Rect clipFrame)
void text(Point2D position, Font f, char text[], optional int rotation)
void pushSurface(Rect rect, int xscr, int yscr, byte alpha)
void popSurface()
void point(Point2D point)
Draw a single-pixel point at the given location and with the given color.
void line(Line2D line, optional int lineWidth)
Draw a line between two points, the given description of size, position, and color.
void curve(Curve2D line, int isteps, optional int lineWidth)
Draw a line between two points, the given description of size, position, and color.
void rect(Rect2D rect)
Draw a filled rectangle using the given description of size, position, and color.
void rectOutline(Rect2D rect, optional int lineWidth)
Draw an outline rectangle using the given description of size, position, and color.
void roundedRect(Rect2D rect, int xRadius, int yRadius)
Draw a filled rectangle with rounded corners using the given description of size, position, and color.
void roundedRectOutline(Rect2D rect, int xRadius, int yRadius, optional int lineWidth)
Draw an outline rectangle with rounded corners using the given description of size, position, and color.
void ellipse(Ellipse2D ellipse)
Draw a filled ellipse using the given description of position, radius, and color.
void ellipseOutline(Ellipse2D ellipse, optional int lineWidth)
Draw an outline ellipse using the given description of position, radius, and color.
void arc(Arc2D ellipse)
Draw a filled arc using the given description of position, radius, and color.
void arcOutline(Arc2D ellipse, optional int lineWidth)
Draw an outline arc using the given description of position, radius, and color.
void pie(Arc2D ellipse)
Draw a filled pie using the given description of position, radius, and color.
void polygon(Polygon2D p)
Draw a filled polygon.
void polygonOutline(Polygon2D p)
Draw an outline polygon.
void polygonBezier(Polygon2D p, int isteps)
Draw a filled polygon bounded by curves.
void pixels(PixelMap map, int x, int y, optional int scaledWidth, int scaledHeight, int rotation, Rect clipFrame)
Draw a rectangle of pixels, at the given position, with the given rotation in degrees.
map The pixels to draw.
x The X position at which to draw the top-left of the pixel map.
y The Y position at which to draw the top-left of the pixel map.
scaledWidth The width in pixels at which to scale the image.
scaledHeight The height in pixels at which to scale the image.
rotation The rotation to apply to the pixel map, in degrees.
clipFrame The clipping boundary.
void text(Point2D position, Font f, char text[], optional int rotation)
Draw a piece of text, at the given position, with the given font.
position The x/y coordinate at which to draw the top left of the text.
f The font with which to draw the text.
text The text to draw.
rotation The rotation to apply to the text, in degrees.
void pushSurface(Rect rect, int xscr, int yscr, byte alpha)
Push a new surface to the surface stack, using the given rect instance to indicate the x/y position and width/height. Any new draw operations will take place inside this surface, with the zero x/y coordinates of draw commands being relative to the top left corner of the surface, and will be clipped at the surface's width/height.
rect The x/y coordinate and width/height of the surface.
xscr The amount, in pixels, by which the surface is 'scrolled' on the X-axis.
yscr The amount, in pixels, by which the surface is 'scrolled' on the Y-axis.
alpha The alpha blend to apply to elements drawn on the surface.
void popSurface()
Pop the top-most surface from the surface stack.