Skip to content

GUI Drawing

App: apps/gui_drawing/

Demonstrates every Gui.draw* canvas primitive rendered directly inside a window. Shapes are laid out in a 3×3 grid; some animate over time using Math.sin. All colors are 0–255.

Terminal window
% ./plume3d gui_drawing

Each primitive in a labelled cell:

PrimitiveMethod
Animated thick linedrawLine
Outlined rect with roundingdrawRect
Filled rect (animated color)drawRectFilled
Outlined ellipsedrawCircle
Filled ellipse (animated)drawCircleFilled
Filled triangledrawTriangleFilled
Arc strokedrawArc
Filled arc/piedrawArcFilled
Text at positiondrawText
Cubic bezier curvedrawCurve
// Coordinates are window-local; colors are 0-255
Gui.drawLine(10, 10, 90, 70, 3, 255, 100, 100, 255)
Gui.drawRectFilled(120, 10, 100, 60, 5, 100, 180, 255, 255)
Gui.drawCircle(240, 10, 70, 70, 2, 255, 200, 50, 255)
Gui.drawTriangleFilled(340, 70, 380, 10, 420, 70, 80, 220, 80, 255)
// Animated pulse
var t = Math.sin(_time * 3)
Gui.drawArcFilled(60, 160, 30, 0, t * 3.14, 255, 150, 50, 255)
// Bezier curve
Gui.drawCurve(10, 200, 60, 140, 120, 260, 180, 200, 2, 200, 100, 255, 255)

All draw* coordinates are relative to the content region of the current window, not the screen. Use Gui.windowGetContentRegion() to get the region origin if needed.

  • Gui — all draw* canvas methods.
  • Mathsin for animation.