34 lines
1.2 KiB
Ada
34 lines
1.2 KiB
Ada
|
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
||
|
--
|
||
|
-- GNU General Public Licence (version 3 or later)
|
||
|
|
||
|
with core, ui;
|
||
|
|
||
|
package body material is
|
||
|
|
||
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
||
|
sprite : array (enumeration) of core.sprite;
|
||
|
|
||
|
------------------------------------------------------------------------------------------
|
||
|
|
||
|
procedure configure is
|
||
|
begin
|
||
|
core.echo (core.comment, "Configuring material components...");
|
||
|
--
|
||
|
for index in enumeration loop
|
||
|
sprite (index) := core.import_sprite ("./sprite/material/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
|
||
|
end loop;
|
||
|
end configure;
|
||
|
|
||
|
------------------------------------------------------------------------------------------
|
||
|
|
||
|
procedure draw (index : in enumeration; x, y : in integer) is
|
||
|
begin
|
||
|
core.draw (sprite (index), x, y);
|
||
|
end draw;
|
||
|
|
||
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
||
|
end material;
|