Module graphics

Source
Expand description

Draw shapes, images, and text on the screen.

Structs§

Angle
An angle between two vectors.
Canvas
Canvas is an Image that can be drawn upon.
Image
A loaded image file.
LineStyle
The same as Style but without a fill color (only stroke color and width).
Point
A point on the screen.
RGB
The RGB value of a color in the palette.
Size
Size of a bounding box for a shape.
Style
Style of a shape.
SubImage
A subregion of an image. Constructed using Image::sub.

Enums§

Color
A pointer to a color in the color palette.

Constants§

HEIGHT
The screen height in pixels.
WIDTH
The screen width in pixels.

Functions§

clear_screen
Fill the whole frame with the given color.
draw_arc
Draw an arc.
draw_circle
Draw a circle with the given diameter.
draw_ellipse
Draw an ellipse (oval).
draw_image
Render an image using the given colors.
draw_line
Draw a straight line from point a to point b.
draw_point
Set a single point (1 pixel is scaling is 1) on the frame.
draw_qr
Render a QR code for the given text.
draw_rect
Draw a rectangle filling the given bounding box.
draw_rounded_rect
Draw a rectangle with rounded corners.
draw_sector
Draw a sector.
draw_sub_image
Draw a subregion of an image.
draw_text
Render text using the given font.
draw_triangle
Draw a triangle.
set_canvas
Set canvas to be used for all subsequent drawing operations.
set_color
Set a color value in the palette.
unset_canvas
Unset canvas set by set_canvas. All subsequent drawing operations will target frame buffer.