Menu quick fix...

This commit is contained in:
Ognjen Milan Robovic 2024-02-19 17:17:19 -05:00
parent cda04b245a
commit 27aeb36d70
2 changed files with 26 additions and 6 deletions

View File

@ -51,7 +51,7 @@ package body menu is
--
for element_index in 0 .. limitation - 1
loop
ui.draw_frame (offset_x + draw_offset, offset_y + draw_offset + element_index * offset, offset, offset);
ui.draw_frame (offset_x + draw_offset, offset_y + draw_offset + element_index * offset, width - 2 * draw_offset, offset);
--
core.draw (trait (index).elements (element_index).icon, offset_x + draw_offset + icon_offset, offset_y + draw_offset + icon_offset + element_index * offset);
core.write (trait (index).elements (element_index).text, offset_x + draw_offset + icon_offset + offset, offset_y + draw_offset + icon_offset + element_index * offset);

View File

@ -103,13 +103,33 @@ package body ui is
offset_x : constant integer := sprite (active, frame_middle).width;
offset_y : constant integer := sprite (active, frame_middle).height;
begin
if width < 2 * offset_x or height < 2 * offset_y then
crop (frame_upper_left, x, y, 0, 0, width / 2, height / 2);
crop (frame_upper_right, x + width / 2, y, offset_x - width / 2, 0, width / 2, height / 2);
crop (frame_lower_left, x, y + height / 2, 0, offset_y - height / 2, width / 2, height / 2);
crop (frame_lower_right, x + width / 2, y + height / 2, offset_x - width / 2, offset_y - height / 2, width / 2, height / 2);
if height < 2 * offset_y then
draw_horizontally (frame_upper, x + offset_x, y, width - 2 * offset_x);
draw_horizontally (frame_lower, x + offset_x, y + height - offset_y, width - 2 * offset_x);
--
crop (frame_upper_left, x, y, 0, 0, sprite (active, frame_upper_left).width, height / 2);
crop (frame_upper_right, x + width - offset_x, y, 0, 0, sprite (active, frame_upper_right).width, height / 2);
crop (frame_lower_left, x, y + height / 2, 0, offset_y - height / 2, sprite (active, frame_lower_left).width, height / 2);
crop (frame_lower_right, x + width - offset_x, y + height / 2, 0, offset_y - height / 2, sprite (active, frame_lower_right).width, height / 2);
return;
end if;
--
--~if width < 2 * offset_x then
--~crop (frame_upper_left, x, y, 0, 0, width / 2, height / 2);
--~crop (frame_upper_right, x + width / 2, y, offset_x - width / 2, 0, width / 2, height / 2);
--~crop (frame_lower_left, x, y + height / 2, 0, offset_y - height / 2, width / 2, height / 2);
--~crop (frame_lower_right, x + width / 2, y + height / 2, offset_x - width / 2, offset_y - height / 2, width / 2, height / 2);
--~return;
--~end if;
--~--
--~if width < 2 * offset_x or height < 2 * offset_y then
--~crop (frame_upper_left, x, y, 0, 0, width / 2, height / 2);
--~crop (frame_upper_right, x + width / 2, y, offset_x - width / 2, 0, width / 2, height / 2);
--~crop (frame_lower_left, x, y + height / 2, 0, offset_y - height / 2, width / 2, height / 2);
--~crop (frame_lower_right, x + width / 2, y + height / 2, offset_x - width / 2, offset_y - height / 2, width / 2, height / 2);
--~return;
--~end if;
--
draw_background (frame_middle, x + offset_x, y + offset_y, width - 2 * offset_x, height - 2 * offset_y);
--
draw_horizontally (frame_upper, x + offset_x, y, width - 2 * offset_x);