text alignments
[fishladder.git] / fishladder.c
index deafa8ec85623730ac1cfefedad5bb14aa0788b6..11d65b0b5c1dae488b02073d1d414cdb0e9c22d6 100644 (file)
@@ -3270,6 +3270,10 @@ void vg_render(void)
 
 void vg_ui(void) 
 {
+   // Drawing world name
+   gui_text( (ui_px [2]){ vg_window_x / 2, 4 }, "THIS IS A WORLD NAME", 2, k_text_align_center );
+   gui_text( (ui_px [2]){ vg_window_x / 2, 28 }, "And here is its cool description yo", 1, k_text_align_center );
+
        if( world.st.state == k_game_state_settings )
        {
                gui_group_id( 35 );
@@ -3289,14 +3293,14 @@ void vg_ui(void)
                        
                        gui_new_node();
                        {
-                               gui_text( "SETTINGS", 2 );
+                               gui_text( ui_global_ctx.cursor, "SETTINGS", 2, 0 );
                        }
                        gui_end();
 
                        // Colour scheme selection
                        ui_global_ctx.cursor[1] += 30;
 
-                       gui_text( "Colour Scheme", 1 );
+                       gui_text( ui_global_ctx.cursor, "Colour Scheme", 1, 0 );
                        ui_global_ctx.cursor[1] += 25;
 
                        gui_new_node();
@@ -3328,16 +3332,18 @@ void vg_ui(void)
                                        if( colour_set_id > 0 )
                                                colour_set_id --;
                                }
-                               gui_text( "<", 1 );
+                               gui_text( ui_global_ctx.cursor, "<", 1, 0 );
                                gui_end_right();
                                
                                ui_global_ctx.cursor[2] = 150;
                                gui_new_node();
                                {
                gui_fill_rect( ui_global_ctx.cursor, 0x33ffffff );
-                                       ui_global_ctx.cursor[0] += 45;
-                                       ui_global_ctx.cursor[1] += 6;
-                                       gui_text( (const char *[]){ "Normal", "Extra1", "Extra2" }[ colour_set_id ], 1 );
+                                       gui_text( 
+                  (ui_px [2]){ ui_global_ctx.cursor[0] + 75, ui_global_ctx.cursor[1] + 6 }, 
+                  (const char *[]){ "Normal", "Extra1", "Extra2" }[ colour_set_id ], 
+                  1, k_text_align_center 
+               );
                                }
                                gui_end_right();
 
@@ -3347,7 +3353,7 @@ void vg_ui(void)
                                        if( colour_set_id < vg_list_size( colour_sets )-1 )
                                                colour_set_id ++;
                                }
-                               gui_text( ">", 1 );
+                               gui_text( ui_global_ctx.cursor, ">", 1, 0 );
                                gui_end_down();
                        }
                        gui_end_down();
@@ -3356,7 +3362,7 @@ void vg_ui(void)
          // TODO: remove code dupe
          ui_global_ctx.cursor[1] += 16;
 
-                       gui_text( "Tile Theme", 1 );
+                       gui_text( ui_global_ctx.cursor, "Tile Theme", 1, 0 );
                        ui_global_ctx.cursor[1] += 20;
 
                        gui_new_node();
@@ -3367,16 +3373,17 @@ void vg_ui(void)
                                        if( world_theme_id > 0 )
                                                world_theme_id --;
                                }
-                               gui_text( "<", 1 );
+                               gui_text( ui_global_ctx.cursor, "<", 1, 0 );
                                gui_end_right();
                                
                                ui_global_ctx.cursor[2] = 150;
                                gui_new_node();
                                {
                gui_fill_rect( ui_global_ctx.cursor, 0x33ffffff );
-                                       ui_global_ctx.cursor[0] += 45;
-                                       ui_global_ctx.cursor[1] += 6;
-                                       gui_text( world_themes[ world_theme_id ].name, 1 );
+                                       gui_text( 
+                  (ui_px [2]){ ui_global_ctx.cursor[0] + 75, ui_global_ctx.cursor[1] + 6 },
+                  world_themes[ world_theme_id ].name, 1, k_text_align_center
+               );
                                }
                                gui_end_right();
 
@@ -3386,7 +3393,7 @@ void vg_ui(void)
                                        if( world_theme_id < vg_list_size( world_themes )-1 )
                                                world_theme_id ++;
                                }
-                               gui_text( ">", 1 );
+                               gui_text( ui_global_ctx.cursor, ">", 1, 0 );
                                gui_end_down();
                        }
                        gui_end_down();