Minor UI changes...

This commit is contained in:
Ognjen Milan Robovic 2024-04-28 17:18:14 -04:00
parent 037386c063
commit ed554ff8fe
3 changed files with 15 additions and 21 deletions

View File

@ -54,8 +54,8 @@ package core is
warning => true, warning => true,
success => true, success => true,
comment => true, comment => true,
import => true, import => false,
export => true export => false
); );
engine_active : boolean := false; engine_active : boolean := false;

View File

@ -165,8 +165,8 @@ begin
--~magic.menu (0, 0, true); --~magic.menu (0, 0, true);
--~might.menu (0, 0, true); --~might.menu (0, 0, true);
-- --
--~ui.draw_menu (60, 60, 256, 256); ui.draw_menu (60, 60, 256, 256);
--~ui.draw_tiny_menu (360, 60, 256, 256); ui.draw_tiny_menu (360, 60, 256, 256);
-- --
menu_render; menu_render;
-- --

View File

@ -58,23 +58,17 @@ package body ui is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure draw (index : in element; x, y : in integer) is procedure draw (index : in element := none;
save_zoom : natural := core.zoom; x : in integer := 0;
begin y : in integer := 0;
core.zoom := 1; width : in integer := 0;
core.draw (sprite (active, index), x, y); height : in integer := 0) is
core.zoom := save_zoom;
end draw;
------------------------------------------------------------------------------------------
procedure crop (index : in element; x, y, width, height : in integer) is
save_zoom : natural := core.zoom; save_zoom : natural := core.zoom;
begin begin
core.zoom := 1; core.zoom := 1;
core.draw (sprite (active, index), x, y, 0, 0, width, height); core.draw (sprite (active, index), x, y, 0, 0, width, height);
core.zoom := save_zoom; core.zoom := save_zoom;
end crop; end draw;
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
@ -86,7 +80,7 @@ package body ui is
end loop; end loop;
-- --
if width mod step > 0 then if width mod step > 0 then
crop (index, x + (width / step) * step, y, width mod step, sprite (active, index).height); draw (index, x + (width / step) * step, y, width mod step, sprite (active, index).height);
end if; end if;
end draw_horizontally; end draw_horizontally;
@ -100,7 +94,7 @@ package body ui is
end loop; end loop;
-- --
if height mod step > 0 then if height mod step > 0 then
crop (index, x, y + (height / step) * step, sprite (active, index).width, height mod step); draw (index, x, y + (height / step) * step, sprite (active, index).width, height mod step);
end if; end if;
end draw_vertically; end draw_vertically;
@ -118,18 +112,18 @@ package body ui is
end loop; end loop;
-- --
if width mod base_width > 0 then if width mod base_width > 0 then
crop (index, x + width - crop_width, y + move_y * base_height, crop_width, base_height); draw (index, x + width - crop_width, y + move_y * base_height, crop_width, base_height);
end if; end if;
end loop; end loop;
-- --
for move_x in 0 .. width / base_width - 1 loop for move_x in 0 .. width / base_width - 1 loop
if height mod base_height > 0 then if height mod base_height > 0 then
crop (index, x + move_x * base_width, y + height - crop_height, base_width, crop_height); draw (index, x + move_x * base_width, y + height - crop_height, base_width, crop_height);
end if; end if;
end loop; end loop;
-- --
if width mod base_width > 0 and height mod base_height > 0 then if width mod base_width > 0 and height mod base_height > 0 then
crop (index, x + width - crop_width, y + height - crop_height, crop_width, crop_height); draw (index, x + width - crop_width, y + height - crop_height, crop_width, crop_height);
end if; end if;
end draw_background; end draw_background;