Commit Graph

4 Commits

Author SHA1 Message Date
f5e53fd13d feat(ui): introduce anchor-based widget positioning system
Replace set_position with anchor and offset for relative positioning. Add parent pointer to widget hierarchy. Remove manual resize logic in UI managers.
2026-07-13 14:52:35 +08:00
e8157ab549 refactor(ui): move scale property to subclasses and fix resize event handling
Remove scale from base Widget class and add per-type set_scale/scale methods to Button, Image, and Label. Dispatch separate WindowResizeEvent alongside existing FrameBufferResizeEvent. Correct centering calculations from `+` to `-` in main menu and world UI managers.
2026-07-13 13:06:09 +08:00
01c9f61d1c ui: add main menu scene and interactive button widget
- Implement MainMenuScene with a "Start Game" button that pushes the WorldScene.
- Extend Button class with background/foreground, hover detection, and size queries.
- Add virtual width/height and event handlers to Widget base class.
- Update WorldUIManager to propagate mouse move events.
- Adjust Window mouse mode based on game running state.
2026-07-13 10:38:30 +08:00
cb1eb25e7b refactor: add framebuffer resize event and separate UI management 2026-07-12 18:38:42 +08:00