class

Egui::Painter

Inherits Reference < Object

Constructors

Instance methods

add(cmd : PaintCmd) : Int32
Source
add_noop

Reserve a slot now, fill it later (egui Painter::set).

Source
arc(center : Pos2, radius : Float64, start_angle : Float64, end_angle : Float64, width : Float64, color : Color32) : Nil
Source
box_shadow(rect : Rect, color : Color32, blur : Float64 = 4.0, rounding : Float64 = 0.0, spread : Float64 = 0.0, offset : Vec2 = Vec2.new(0.0, 0.0), inset : Bool = false) : Nil

CSS box-shadow — see ShadowCmd. Paint order is the caller's business, mirroring CSS: an outset shadow goes UNDER the widget (call before the fill rect), an inset one over it (after).

Source
circle(center : Pos2, radius : Float64, fill : Color32 | Nil = nil, stroke : Color32 | Nil = nil, stroke_width : Float64 = 1.0) : Nil
Source
circle_filled(center : Pos2, radius : Float64, fill : Color32) : Nil
Source
circle_stroke(center : Pos2, radius : Float64, stroke : Color32, stroke_width : Float64 = 1.0) : Nil
Source
clear
Source
clip
Source
clip=(rect : Rect)
Source
commands
Source
commands_in_layer_order

egui GraphicLayers::drain(order): flatten per layer, back to front — ascending z; within one z, push order (registration order) decides, so a container's back-filled frame stays under its contents.

Source
image(rect : Rect, texture_id : UInt64, uv : Rect | Nil = nil, tint : Color32 = Color32.new(255, 255, 255, 255), nearest : Bool = false) : Nil

Full quad of the texture by default; nearest requests point sampling (pixel-art canvases).

Source
layer

Which layer subsequently pushed commands belong to (egui Painter::with_layer_id): either a named Order or an explicit numeric z (see LayerId).

Source
layer=(order : Order)
Source
layer=(z : Int32)
Source
line(p1 : Pos2, p2 : Pos2, width : Float64, color : Color32) : Nil
Source
paint_galley(pos : Pos2, galley : Galley, fonts : Fonts, default_color : Color32, family : String | Nil = nil, resolve : String | Nil, Bool, Bool -> Fonts | Nil = nil) : Nil

Paint a laid-out Galley with pos as its top-left corner (upstream Painter::galley). Emits one TextCmd per row run — that's where per-run colors come from — plus underline lines. family: is the stack the galley was laid out with, so the draw commands hit the same font the measurement used; a run carrying its OWN family (inline code) or variant flags (bold/italic) overrides it per run — resolve (a Context#fonts_for closure) supplies that stack for the underline/strike/chip width measurement, exactly like Fonts#layout did for the wrap.

Source
rect(rect : Rect, rounding : Float64 = 0.0, fill : Color32 | Nil = nil, stroke_color : Color32 | Nil = nil, stroke_width : Float64 = 1.0, fill2 : Color32 | Nil = nil) : Nil
Source
rect_gradient(rect : Rect, rounding : Float64, c1 : Color32, c2 : Color32) : Nil

Vertical gradient fill (top c1 → bottom c2).

Source
rect_replace(rect : Rect, color : Color32) : Nil

Replace-blend rect: instead of blending over the destination, it OVERWRITES it — rgb AND alpha — with color given straight (non-premultiplied); the command carries it premultiplied, ready for an alpha-composited (per-pixel-transparent) swapchain. This is the primitive for a widget that must show the desktop through an otherwise opaque UI (the terminal grid): it punches the exact alpha into the framebuffer, no blending needed behind it. In a normal opaque window it degenerates to a plain solid rect.

Source
set(index : Int32, cmd : PaintCmd) : Nil
Source
text(pos : Pos2, text : String, size : Float64, color : Color32, family : String | Nil = nil, bold : Bool = false, italic : Bool = false) : Nil

Draw text with pos as the LEFT-CENTER of the text bounding box (upstream anchors at the galley's left edge + baseline; backends convert using their font metrics — see backend/sokol/fontstash). family: draws through that named stack (Context#fonts_for); nil uses the primary one. bold:/italic: draw through the primary stack's REAL variant faces (a missing variant degrades to the base face — no emulation).

Source