UI and world scaling code...

This commit is contained in:
Ognjen Milan Robovic 2024-04-25 05:27:44 -04:00
parent 0653ca2f57
commit 310a6d035d
3 changed files with 15 additions and 11 deletions

View File

@ -488,16 +488,16 @@ package body core is
procedure render_sprite (sprite, x, y, u, v, width, height : in integer) is
begin
draw_image (data => texture_array (sprite),
uv => (float (u), float (v), float (width), float (height)),
view => (float (x), float (y)),
tint => (255, 255, 255, 255));
--~megadraw (data => texture_array (sprite),
--~uv => (float (u), float (v), float (width), float (height)),
--~view => (0.0, 0.0, float (x), float (y)),
--~origin => (0.0, 0.0),
--~rotate => 0.0,
--~tint => (255, 255, 255, 255));
--~draw_image (data => texture_array (sprite),
--~uv => (float (u), float (v), float (width), float (height)),
--~view => (float (x), float (y)),
--~tint => (255, 255, 255, 255));
megadraw (data => texture_array (sprite),
uv => (float (u), float (v), float (width), float (height)),
view => (float (x), float (y), float (width) * zoom, float (height) * zoom),
origin => (0.0, 0.0),
rotate => 0.0,
tint => (255, 255, 255, 255));
end render_sprite;
------------------------------------------------------------------------------------------

View File

@ -96,7 +96,7 @@ package core is
camera : vector := (0, 0);
zoom : boolean := false;
zoom : float := 2.0;
hexagon_grid_sprite : sprite;
hexagon_fill_sprite : sprite;

View File

@ -25,14 +25,18 @@ package body ui is
procedure draw (index : in codex; x, y : in integer) is
begin
core.zoom := 1.0;
core.draw (sprite (active, index), x, y);
core.zoom := 2.0;
end draw;
------------------------------------------------------------------------------------------
procedure crop (index : in codex; x, y, u, v, width, height : in integer) is
begin
core.zoom := 1.0;
core.crop (sprite (active, index), x, y, u, v, width, height);
core.zoom := 2.0;
end crop;
------------------------------------------------------------------------------------------