Files
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

46 lines
1.1 KiB
Go

package widgets
import (
"aego/core/mathx"
"aego/ui/core"
)
func Chevron(c *core.Context, r mathx.Rect, open bool, col mathx.Color) {
s := float32(int(min(r.W, r.H) * 0.42))
if s < 6 {
s = 6
}
cx, cy := r.X+r.W/2, r.Y+r.H/2
l := c.List()
half := float32(int(s/2 + 0.5))
if open {
for i := float32(0); i < half; i++ {
w := s - 2*i
l.Rect(mathx.Rect{X: float32(int(cx - w/2)), Y: float32(int(cy - half/2 + i)), W: w, H: 1}, col)
}
return
}
for i := float32(0); i < half; i++ {
h := s - 2*i
l.Rect(mathx.Rect{X: float32(int(cx - half/2 + i)), Y: float32(int(cy - h/2)), W: 1, H: h}, col)
}
}
func CheckMark(c *core.Context, r mathx.Rect, col mathx.Color) {
l := c.List()
t := max(float32(1.5), r.H/7)
seg := func(a, b mathx.Vec2) {
d := b.Sub(a)
n := int(d.Len()/(t*0.5)) + 1
for i := 0; i <= n; i++ {
p := a.Add(d.Scale(float32(i) / float32(n)))
l.Rect(mathx.Rect{X: p.X - t/2, Y: p.Y - t/2, W: t, H: t}, col)
}
}
a := mathx.Vec2{X: r.X + r.W*0.22, Y: r.Y + r.H*0.52}
m := mathx.Vec2{X: r.X + r.W*0.42, Y: r.Y + r.H*0.72}
e := mathx.Vec2{X: r.X + r.W*0.78, Y: r.Y + r.H*0.30}
seg(a, m)
seg(m, e)
}