Graphics
Provides a cross platform API to draw lines, shapes, text, images, and other graphics onto a window or buffer. By default, the coordinate system assumes the origin is at the top-left corner (0, 0). Positive x values go right and positive y values go down. Angle units like radians and degrees start at 0 and positive values go clockwise. The backend uses OpenGL 3 on desktop and Canvas/WebGL for web. Support for WebGPU is planned. Currently, the API is focused on 2D graphics, but there are plans to add 3D graphics utilities.
Converts HSV to RGB. Hue is in degrees [0,100] and saturation/value are [0,1].
This provides an interface to the underlying graphics handle. It has a similar API to Web Canvas.
Returns the FontId of "Bitstream Vera Sans" the default font embedded into the runtime.
Sets the current fill color for painting shapes.
Returns the current fill color.
Sets the current stroke color for painting shape outlines.
Returns the current stroke color.
Sets the current line width for painting shape outlines.
Returns the current line width.
Path can be absolute or relative to the cwd.
Path can be absolute or relative to the cwd.
Paints a rectangle with the current fill color.
Paints a rectangle outline with the current stroke color.
Paints a round rectangle with the current fill color.
Paints a round rectangle outline with the current stroke color.
Shifts the origin x units to the right and y units down.
Scales from the origin x units horizontally and y units vertically. Negative value flips the axis. Value of 1 does nothing.
Rotates the origin by radians clockwise.
Rotates the origin by degrees clockwise.
Resets the current transform to identity.
Saves the current graphics state by pushing onto a stack.
Restores the graphics state on top of the stack.
Given logical 2D coordinates, return the interpolation to screen coordinates with the current transform.
Sets the current font and font size.
Sets the current font size.
Sets the current text align.
Sets the current text baseline.
Paints text with the current fill color.
Paints a circle sector in radians with the current fill color.
Paints a circle sector in degrees with the current fill color.
Paints a circle arc in radians with the current stroke color.
Paints a circle arc in degrees with the current stroke color.
Paints a circle with the current fill color.
Paints a circle outline with the current stroke color.
Paints a ellipse with the current fill color.
Paints a ellipse outline with the current stroke color.
Paints a ellipse sector in radians with the current fill color.
Paints a ellipse sector in degrees with the current fill color.
Paints a ellipse arc in radians with the current stroke color.
Paints a ellipse arc in degrees with the current stroke color.
Paints a point with the current stroke color.
Paints a line with the current stroke color.
Paints a cubic bezier curve with the current stroke color.
Paints a quadratic bezier curve with the current stroke color.
Paints a triangle with the current fill color.
Paints a convex polygon with the current fill color.
Paints any polygon with the current fill color.
Paints any polygon outline with the current stroke color.
Compiles svg content string into a draw list handle.
Paints svg content in UTF-8.
Executes a draw list handle.
Paints an image.