Files
aego/ui/icon.go
T
sanspie 17cb5e4291 Stage 2-5: assets, scene/ECS, editor, 3D, and Aego Script
Stage 2: render pipeline and UI toolkit over gpu/platform.
Stage 3: schema registry, asset pipeline + runtime loader, scene graph and ECS.
Stage 4: editor — docking, inspector, scene/game views, play mode, asset browser, console, profiler; 4.5 adds the 3D foundation (mixed 2D/3D spaces, meshes, depth).
Stage 5: Aego Script — compiler (lexer/parser/types/resolver/checker/asm/compiler), bytecode with verifier and register VM, instance runtime, stdlib, native bindings, and editor/CLI integration (aego run/edit/check/test/dump).
2026-10-08 13:17:28 +03:00

26 lines
693 B
Go

package ui
import (
"aego/core/mathx"
"aego/ui/core"
"aego/ui/widgets"
)
func Icon(c *core.Context, id string, size float32) {
r := c.Cursor().Next(size)
widgets.IconAt(c, mathx.Rect{X: r.X, Y: r.Y, W: size, H: size}, id, c.Theme.Text)
}
func IconButton(c *core.Context, uid core.ID, id string, size float32, tooltip string) bool {
th := &c.Theme
r := c.Cursor().Next(size + 6)
br := mathx.Rect{X: r.X, Y: r.Y, W: size + 6, H: size + 6}
clicked := c.Clicked(uid, br)
if c.Hot() == uid || c.Active() == uid {
c.Rect(br, th.ButtonHover)
}
widgets.IconAt(c, mathx.Rect{X: br.X + 3, Y: br.Y + 3, W: size, H: size}, id, th.Text)
widgets.Tooltip(c, uid, tooltip)
return clicked
}