Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

_markers

Marker-shape canvas command generators used by Z.plot.points. Mirrors the marker shapes that the deleted egui_plot::MarkerShape enum exposed: circle, square, diamond, cross, plus, up, down, left, right, asterisk. Unknown shapes fall back to circle with a console warning (parity with the deleted Rust path).

Exports

  • M.commands(shape: MarkerShape, cx: number, cy: number, radius: number, opts: MarkerOpts?) -> { CanvasCommand } — list of canvas commands rendering the marker.

Types:

  • MarkerShape = "circle" | "square" | "diamond" | "cross" | "plus" | "up" | "down" | "left" | "right" | "asterisk" | string — string fallthrough warns and falls back to circle.
  • MarkerOpts = { fill: string?, stroke: string?, strokeWidth: number? }
  • CanvasCommand = { [string]: any } — opaque canvas-renderer command.

Usage

local Markers = require("@builtin::modules.zui.widget._markers")

local cmds = Markers.commands("diamond", 50, 50, 4, { fill = "#fff" })
-- cmds is a list of canvas commands ready to splice into a canvas.

Notes

  • Each shape returns one or more canvas commands centered at (cx, cy) with bounding-circle radius radius.
  • cross, plus, asterisk, up/down/left/right are stroke-based and fall back to opts.fill (or "#FFFFFF") for the line color when no stroke is supplied.
  • Unknown shapes warn via log.warn (when available) and fall back to the circle marker — parity with the deleted Rust enum's default arm.
  • Pure module — no engine state, no state owned here. Safe to call from any context.