Fill rect with color; radius rounds the corners and border draws an outline inside.
- ui: the UI whose display list gets the entry.
- rect: the area to fill, in points.
- color: the fill colour.
- radius: corner radius in points.
- border: outline width in points.
- border_color: outline colour.
ui := headless();
defer free_ui(*ui);
draw_rect(*ui, .{ 10, 10, 100, 40 }, rgb(40, 40, 60), radius = 6, border = 1, border_color = rgb(90, 90, 120));
assert(ui.draw.cmds.count == 1);draw_rect :: (
ui: *UI_State,
rect: Rect,
color: Color,
radius: float = 0,
border: float = 0,
border_color: Color = .{}
)
Fill rect with color; radius rounds the corners and border draws an outline inside.
Parameters
- ui: *UI_State
- the UI whose display list gets the entry.
- rect: Rect
- the area to fill, in points.
- color: Color
- the fill colour.
- radius: float = 0
- corner radius in points.
- border: float = 0
- outline width in points.
- border_color: Color = .{}
- outline colour.
ui := headless();
defer free_ui(*ui);
draw_rect(*ui, .{ 10, 10, 100, 40 }, rgb(40, 40, 60), radius = 6, border = 1, border_color = rgb(90, 90, 120));
assert(ui.draw.cmds.count == 1);