diff --git a/source/core.adb b/source/core.adb index 18ba3eb..26d125d 100644 --- a/source/core.adb +++ b/source/core.adb @@ -115,9 +115,9 @@ package body core is ------------------------------------------------------------------------------------------ - procedure write (text : in string; x, y : in integer) is + procedure write (text : in string; x, y : in integer; colour : in integer := 16#CCCCCC#) is begin - render_string (c_string (text), x, y, 16#CCCCCC#, false); + render_string (c_string (text), x, y, colour, false); end write; ------------------------------------------------------------------------------------------ diff --git a/source/core.ads b/source/core.ads index aa4526f..0e1a0cd 100644 --- a/source/core.ads +++ b/source/core.ads @@ -101,7 +101,8 @@ package core is procedure crop (data : in sprite; x, y, u, v, width, height : in integer); procedure draw (data : in sprite; x, y : in integer); procedure move (data : in sprite; x, y, frame, state : in integer); - procedure write (text : in string; x, y : in integer); + + procedure write (text : in string; x, y : in integer; colour : in integer := 16#CCCCCC#); procedure hexagonal_grid (x, y, width, height : in integer; fill : in boolean); diff --git a/source/menu.adb b/source/menu.adb index c34cd4c..43aae60 100644 --- a/source/menu.adb +++ b/source/menu.adb @@ -49,6 +49,7 @@ package body menu is return; end if; -- + ui.draw_title_bar (x, y, width, trait (index).title); ui.draw_tiny_menu (x, y, width, height, true); -- for element_index in 0 .. trait (index).length - 1 diff --git a/source/raylib.c b/source/raylib.c index 1a12f41..963e720 100644 --- a/source/raylib.c +++ b/source/raylib.c @@ -100,7 +100,7 @@ void render_string (char * string, int x, int y, int colour, char monospace) { new_tint.g = ((colour & 0X00FF00) >> 8) % 256; new_tint.b = ((colour & 0X0000FF) >> 0) % 256; - DrawTextPro ((monospace != 0) ? mono : font, string, position, dump, 0.0, 24, 6, new_tint); + DrawTextPro ((monospace != 0) ? mono : font, string, position, dump, 0.0, 18, 3, new_tint); } void engine_configure (void) { diff --git a/source/ui.adb b/source/ui.adb index db30f94..2ff0529 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -121,6 +121,19 @@ package body ui is ------------------------------------------------------------------------------------------ + procedure draw_title_bar (x, y, width : in integer; title : in string) is + middle_width : constant integer := width - sprite (active, title_bar_left).width - sprite (active, title_bar_right).width; + begin + draw (title_bar_left, x, y - sprite (active, title_bar_left).height); + draw (title_bar_right, x + middle_width + sprite (active, title_bar_left).width, y - sprite (active, title_bar_right).height); + -- + draw_horizontally (title_bar_middle, x + sprite (active, title_bar_left).width, y - sprite (active, title_bar_middle).height, middle_width); + -- + core.write (title, x + sprite (active, title_bar_left).width - 12, y - sprite (active, title_bar_middle).height + 24, 16#222222#); + end draw_title_bar; + + ------------------------------------------------------------------------------------------ + procedure draw_menu (x, y, width, height : in integer; background : in boolean) is offset : constant integer := sprite (active, none).width; begin diff --git a/source/ui.ads b/source/ui.ads index d7d08da..d9dc944 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -17,7 +17,12 @@ package ui is tiny_border_upper, tiny_border_lower, tiny_border_left, tiny_border_right, frame_upper_left, frame_upper, frame_upper_right, frame_left, frame_middle, frame_right, - frame_lower_left, frame_lower, frame_lower_right + frame_lower_left, frame_lower, frame_lower_right, + cursor, + fill_bar_left, fill_bar_horizontal, fill_bar_right, + fill_in_left, fill_in_horizontal, fill_in_right, + scroll_bar_lower, scroll_bar_middle, scroll_bar_upper, + title_bar_left, title_bar_middle, title_bar_right ); ------------------------------------------------------------------------------------------ @@ -34,6 +39,8 @@ package ui is procedure draw_frame (x, y, width, height : in integer); + procedure draw_title_bar (x, y, width : in integer; title : in string); + procedure draw_menu (x, y, width, height : in integer; background : in boolean); procedure draw_tiny_menu (x, y, width, height : in integer; background : in boolean);