Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 4, 2026

Converting UI rendering from raylib's immediate-mode drawing API to citrus-engine's batch renderer in preparation for full raylib deprecation.

Changes

Converted Files

  • notification_center.cpp - Toast notifications, panel rendering, filter controls
  • history_panel.cpp - Action history display with scroll indicators
  • tutorial_manager.cpp - Tutorial overlays, progress bars, step indicators
  • placement_system.cpp - Building preview ghosts, construction progress bars
  • tooltip.cpp - Tooltip rendering

API Mapping

// Before
DrawRectangle(x, y, w, h, color);
DrawText(text, x, y, fontSize, color);
DrawRectangleLines(x, y, w, h, color);

// After
engine::ui::BatchRenderer::SubmitQuad(Rectangle{x, y, w, h}, UITheme::ToEngineColor(color));
engine::ui::BatchRenderer::SubmitText(text, x, y, fontSize, UITheme::ToEngineColor(color));
// Border requires 4 SubmitLine calls

Missing Features in Citrus Engine

Circle Drawing - DrawCircle has no BatchRenderer equivalent. Approximating with square quads (affects notification badges).

Rectangle Borders - DrawRectangleLines requires 4 separate SubmitLine calls instead of single-call border drawing.

Deferred

save_load_menu.cpp - Low priority (save/load UI only), can convert separately if needed.

Original prompt

using the existing citrus engine UI elements (some of the docs are here https://adam4813.github.io/citrus-engine/ui-components/) and referencing already converted parts such as @src\ui\hud\hud.cpp @src\ui\general_settings_menu.cpp , find any usages of raylib's drawing methods e.g. DrawText and DrawLine and replace them with the engine::ui::batch_renderer Submit equivalents similar to @src\ui\main_menu.cpp . We are doing a full conversion from raylib eventually, but certain features may not exist in the citrus engine yet, identify any missing features as well

Created from Copilot CLI via the copilot delegate command.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 4, 2026 06:50
…ngine BatchRenderer

Co-authored-by: adam4813 <3011917+adam4813@users.noreply.github.com>
- Converted all DrawRectangle calls to BatchRenderer::SubmitQuad
- Converted all DrawText calls to BatchRenderer::SubmitText
- Converted all DrawRectangleLines calls to 4 SubmitLine calls for borders
- Used engine::ui::Color for color conversion

Co-authored-by: adam4813 <3011917+adam4813@users.noreply.github.com>
…chRenderer

- Converted placement_system.cpp DrawRectangle/DrawText calls to BatchRenderer
- Completed tooltip.cpp conversion (last DrawRectangleLines call)
- All core UI components now use BatchRenderer except save_load_menu.cpp

Co-authored-by: adam4813 <3011917+adam4813@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace raylib drawing methods with batch renderer equivalents Replace raylib drawing methods with citrus-engine BatchRenderer API Jan 4, 2026
Copilot AI requested a review from adam4813 January 4, 2026 07:09
- Add Initialize() and Shutdown() methods following the pattern from
  AchievementsMenu and ModsMenu
- Replace manual BatchRenderer drawing with Panel, Button, Text, Container,
  and ContainerBuilder UI components
- Add ProcessMouseEvent() for proper event handling through the UI tree
- Use VerticalLayout and HorizontalLayout for automatic child positioning
- Add ScrollComponent for scrollable notification list
- Maintain backward-compatible HandleClick() for legacy callers
- Keep toast rendering using BatchRenderer (appropriate for transient overlays)
- Update HUD to call Initialize() on NotificationCenter creation
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.

2 participants