xhads/source/resource.adb

33 lines
1.4 KiB
Ada
Raw Normal View History

with core, ui, resource;
2024-02-15 21:03:09 -05:00
use resource;
package body resource is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
procedure configure is
begin
for index in codex
loop
2024-02-19 21:29:11 -05:00
sprite (index) := core.load_sprite ("./sprite/resource/" & core.lowercase (codex'image (index)) & ".png", 1, 1);
end loop;
end configure;
------------------------------------------------------------------------------------------
2024-02-15 21:03:09 -05:00
procedure draw (index : in codex; x, y : in integer) is
begin
2024-02-19 21:29:11 -05:00
core.draw (sprite (index), x, y);
2024-02-15 21:03:09 -05:00
end draw;
2024-02-19 21:29:11 -05:00
------------------------------------------------------------------------------------------
function name (index : in integer) return core.short_string is begin return trait (codex'val (index)).name; end name;
function base (index : in integer) return base_limit is begin return trait (codex'val (index)).base; end base;
function icon (index : in integer) return core.sprite is begin return sprite (codex'val (index)); end icon;
2024-02-15 21:03:09 -05:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end resource;