Skip to content

feat(ui): UI System — RF4.11#61

Merged
LyeZinho merged 3 commits intomainfrom
35-ui-system
May 8, 2026
Merged

feat(ui): UI System — RF4.11#61
LyeZinho merged 3 commits intomainfrom
35-ui-system

Conversation

@LyeZinho
Copy link
Copy Markdown
Member

@LyeZinho LyeZinho commented May 8, 2026

Summary

  • UIComponents.hppUIColor, UIRect, RectTransform, UIStyle, UIWidget, UIButton, UILabel, UIProgressBar, UISlider, UICheckbox
  • UISystem.hpp — retained-mode ECS UI system: factory helpers (createCanvas/Panel/Button/Label/ProgressBar/Slider/Checkbox), bindValue (value binding via getter lambda), hitTest (sibling-order aware), input injection, 8-pass BFS layout
  • 35 tests in test_ui.cpp covering components, factory, layout, hitTest, click/hover callbacks, bindValue, siblingOrder

Notes

  • UIColor uses f32 channels (engine Color uses u8 — incompatible with UI float requirements)
  • bindValue uses std::function<f32(World&)> getter instead of bindComponent (avoids C++ reflection)
  • Layout runs up to 8 passes to handle arbitrary nesting depth since forEach doesn't guarantee topological order
  • kUIInvalidParent = 0xFFFFFFFFu sentinel for root canvas
  • All includes relative to src/ root — compatible with GCC (Linux CI) and MSVC (Windows)

- UIComponents.hpp: UIColor, UIRect, RectTransform, UIStyle, UIWidget,
  UIButton, UILabel, UIProgressBar, UISlider, UICheckbox
- UISystem.hpp: createCanvas/Panel/Button/Label/ProgressBar/Slider/Checkbox,
  bindValue, hitTest, injectMousePosition/Click, 8-pass layout, processInput
- 35 tests in test_ui.cpp covering components, factory, layout, hitTest,
  onClick/onHoverEnter callbacks, bindValue, siblingOrder
- Caffeine.hpp: add UI includes
- docs/fase4/ui.md: updated to ✅ with actual implemented API
- docs/fase4/README.md: UI System row updated to ✅
@LyeZinho LyeZinho linked an issue May 8, 2026 that may be closed by this pull request
5 tasks
@LyeZinho LyeZinho merged commit c143f95 into main May 8, 2026
1 check passed
@LyeZinho LyeZinho deleted the 35-ui-system branch May 8, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI System

1 participant