# HG changeset patch # User Mike Becker # Date 1779486251 -7200 # Node ID ef85db00341592e26eb9481fe184d9aa0d13984a # Parent 3bb4f69b94e05ce8509b567803920ebd98753a25 first attempt to create a UI for the atlas editor diff -r 3bb4f69b94e0 -r ef85db003415 tools/atlas-editor.c --- a/tools/atlas-editor.c Thu May 21 12:34:40 2026 +0200 +++ b/tools/atlas-editor.c Fri May 22 23:44:11 2026 +0200 @@ -27,8 +27,34 @@ #include +static void draw_atlas(UiEvent* evt, UiGraphics* g, void* data) { + ui_graphics_color(g, 255, 128, 0); + ui_draw_rect(g, 0, 0, g->width, g->height, true); +} + static void application_startup([[maybe_unused]] UiEvent *event, [[maybe_unused]] void *data) { UiObject *window = ui_window("Ascension - Texture Atlas Editor"); + + ui_grid(window, .columnspacing = 10, .margin = 10, .fill = true) { + ui_frame(window, .hexpand = true, .hfill = true, .vexpand = true, .vfill = true) { + ui_drawingarea(window, .draw = draw_atlas); + } + ui_vbox(window, .spacing = 5) { + ui_grid(window, .columnspacing = 10, .def_hexpand = true, .def_hfill = true) { + ui_button(window, .label = "Load Atlas"); + ui_button(window, .label = "Save Atlas"); + } + ui_button(window, .label = "Load Texture"); + ui_separator(window); + ui_grid(window, .columnspacing = 10, .rowspacing = 2, .def_vfill = true) { + ui_label(window, .label = "Tile Width:"); + ui_textfield(window, .width = 20); + ui_label(window, .label = "Tile Height:"); + ui_textfield(window, .width = 20); + } + } + } + ui_show(window); }