Renders a brush-shape outline as a procedurally-drawn icon inside a [Button]. Used by [TerrainPaletteUI] to give each brush-mode button a visible 36x36 glyph without relying on a [Texture2D] resource (which fails to load in some web exports and renders as a solid dark rectangle —). Drives painting through [method CanvasItem._draw] so the icon works in headless smoke tests, web exports, and desktop builds equally. The shape generator is self-contained (no dependency on [BrushShapeGenerator]) so this UI helper has no build-system coupling.
Source: addons/grid_placement/ui/terrain/brush_shape_icon_button.gd
Syntax
class BrushShapeIconButton extends ButtonMembers
| Name | Kind | Summary |
|---|---|---|
brush_shape | Property | ObjectTool enum value mirrors [enum PlacementEnums.ObjectTool]: 0 SINGLE, 1 LINE, 2 RECTANGLE_FILL, 3 RECTANGLE_OUTLINE, 4 FLOOD_FILL. |
brush_width | Property | |
brush_height | Property | |
is_active | Property | When true, the dots render bright white so the glyph remains visible against the brighter "active-shape" background the parent UI applies (see ). |
rect_size | Property | |
coords | Property | |
lo | Property | |
hi | Property | |
extent | Property | |
pad | Property | |
inner | Property | |
cell_px | Property | |
origin_x | Property | |
origin_y | Property | |
half | Property | |
dot_color | Property | |
painted | Property | |
pos | Property | |
w | Property | |
h | Property | |
coords | Property | |
steps | Property | |
t | Property | |
offsets | Property |
Source
addons/grid_placement/ui/terrain/brush_shape_icon_button.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs