| 25 * POSSIBILITY OF SUCH DAMAGE. |
25 * POSSIBILITY OF SUCH DAMAGE. |
| 26 */ |
26 */ |
| 27 |
27 |
| 28 #include <ui/ui.h> |
28 #include <ui/ui.h> |
| 29 |
29 |
| |
30 static void draw_atlas(UiEvent* evt, UiGraphics* g, void* data) { |
| |
31 ui_graphics_color(g, 255, 128, 0); |
| |
32 ui_draw_rect(g, 0, 0, g->width, g->height, true); |
| |
33 } |
| |
34 |
| 30 static void application_startup([[maybe_unused]] UiEvent *event, [[maybe_unused]] void *data) { |
35 static void application_startup([[maybe_unused]] UiEvent *event, [[maybe_unused]] void *data) { |
| 31 UiObject *window = ui_window("Ascension - Texture Atlas Editor"); |
36 UiObject *window = ui_window("Ascension - Texture Atlas Editor"); |
| |
37 |
| |
38 ui_grid(window, .columnspacing = 10, .margin = 10, .fill = true) { |
| |
39 ui_frame(window, .hexpand = true, .hfill = true, .vexpand = true, .vfill = true) { |
| |
40 ui_drawingarea(window, .draw = draw_atlas); |
| |
41 } |
| |
42 ui_vbox(window, .spacing = 5) { |
| |
43 ui_grid(window, .columnspacing = 10, .def_hexpand = true, .def_hfill = true) { |
| |
44 ui_button(window, .label = "Load Atlas"); |
| |
45 ui_button(window, .label = "Save Atlas"); |
| |
46 } |
| |
47 ui_button(window, .label = "Load Texture"); |
| |
48 ui_separator(window); |
| |
49 ui_grid(window, .columnspacing = 10, .rowspacing = 2, .def_vfill = true) { |
| |
50 ui_label(window, .label = "Tile Width:"); |
| |
51 ui_textfield(window, .width = 20); |
| |
52 ui_label(window, .label = "Tile Height:"); |
| |
53 ui_textfield(window, .width = 20); |
| |
54 } |
| |
55 } |
| |
56 } |
| |
57 |
| 32 ui_show(window); |
58 ui_show(window); |
| 33 } |
59 } |
| 34 |
60 |
| 35 int main(int argc, char** argv) { |
61 int main(int argc, char** argv) { |
| 36 ui_init("asc_atlas_editor", argc, argv); |
62 ui_init("asc_atlas_editor", argc, argv); |