Skip to content

Draw Rectangle

Mikkel102454 edited this page Oct 6, 2026 · 2 revisions

draw_rectangle

Draw a rectangle.

Arguments

All listed arguments are required.

Name Type Meaning
x_start, y_start integer Top-left corner
x_end, y_end integer Bottom-right corner
color string Opaque palette color
width string 1x1, 2x2, 3x3, or 4x4
fill string empty for outline; full for filled

Example

{
  "cmd": "draw_rectangle",
  "args": {
    "x_start": 20,
    "y_start": 70,
    "x_end": 70,
    "y_end": 120,
    "color": "yellow",
    "width": "1x1",
    "fill": "empty"
  }
}

Behavior

Use ordered corners inside the display. Outline boundary lines include both endpoints; stroke width can extend beyond the nominal boundary. Filled rectangles use horizontal scan lines with an exclusive final Y row: at width 1x1, X runs through x_end, but Y stops before y_end. Do not substitute clear_window when exact edge behavior matters.

See Command Reference, Color Palette, and Renderer Notes.

Implementation references

Clone this wiki locally