Canvas library allowing for drawing basic shapes. Coordinates are based on the screen.
fn drawText
fn drawText*(text: str, pos: th::Vf2, color: uint32, size: th::fu) {
Draws a basic pixel text. Only ascii is supported.
fn textSize
fn textSize*(text: str, scale: th::fu): th::Vf2 {
Returns the size of text taken by an equivalent drawText call.
Pixel Font
var pixelFont*: PixelFont
The pixelFont
variable exposes the canvas pixel font as a generic font.
fn drawRect
fn drawRect*(color: uint32, r: rect::Rect) {
Draws a Rectangle.
fn drawLine
fn drawLine*(color: uint32, b, e: th::Vf2, thickness: th::fu) {
Draws a line.
fn drawRectLines
fn drawRectLines*(color: uint32, r: rect::Rect, thickness: real32 = 1.0) {
Draws rect border.
fn drawQuad
fn drawQuad*(color: uint32, q: th::Quad) {
Draws a convex quad.
fn drawTrig
fn drawTrig*(color: uint32, a, b, c: th::Vf2) {
Draws a triangle.
fn beginScissorRect
fn beginScissorRect*(r: rect::Rect, debug: bool = false) {
Disable rendering outside of rect r
fn endScissor
fn endScissor*() {
Stops cropping