2024-03-18 14:40:43 -04:00
|
|
|
with Raylib;
|
|
|
|
use Raylib;
|
2024-03-18 08:06:11 -04:00
|
|
|
|
|
|
|
procedure Window is
|
|
|
|
|
2024-03-18 10:10:41 -04:00
|
|
|
Text : String := "Heyo world!" & Character'Val (0);
|
|
|
|
|
|
|
|
Dragdown : Texture;
|
|
|
|
|
|
|
|
X : Integer := 120;
|
|
|
|
Y : Integer := 120;
|
|
|
|
|
2024-03-18 08:06:11 -04:00
|
|
|
begin
|
|
|
|
|
|
|
|
Open_Window (720, 360, "Heyo Raylib!" & Character'Val (0));
|
|
|
|
|
2024-03-18 14:40:43 -04:00
|
|
|
Set_Exit_Key (Key_Q); -- Default is Key_Escape
|
2024-03-18 10:10:41 -04:00
|
|
|
Set_Target_FPS (72); -- Default is 60
|
|
|
|
|
|
|
|
Dragdown := Load_Texture ("./texture.png" & Character'Val (0));
|
|
|
|
|
2024-03-18 08:06:11 -04:00
|
|
|
Main_Loop: loop
|
|
|
|
exit when Window_Should_Close;
|
|
|
|
--
|
|
|
|
Begin_Drawing;
|
|
|
|
--
|
2024-03-18 14:40:43 -04:00
|
|
|
Clear_Background (Sky_Blue);
|
|
|
|
--
|
|
|
|
Draw_Texture (Dragdown, 100, 100, White);
|
|
|
|
Draw_Text_Pro (Get_Font_Default, Text, (90.0, 90.0), (9.0, 9.0), 0.0, 32.0, 4.0, Red);
|
|
|
|
Draw_FPS (60, 60);
|
|
|
|
Draw_Line (0, 0, 300, 300, Black);
|
|
|
|
Draw_Rectangle (120, 120, 30, 60, Blue);
|
2024-03-18 10:10:41 -04:00
|
|
|
--
|
2024-03-18 14:40:43 -04:00
|
|
|
if Is_Key_Pressed (Key_W) then Y := Y - 10; end if;
|
|
|
|
if Is_Key_Pressed (Key_S) then Y := Y + 10; end if;
|
|
|
|
if Is_Key_Pressed (Key_A) then X := X - 10; end if;
|
|
|
|
if Is_Key_Pressed (Key_D) then X := X + 10; end if;
|
2024-03-18 08:06:11 -04:00
|
|
|
--
|
|
|
|
End_Drawing;
|
|
|
|
end loop Main_Loop;
|
|
|
|
|
2024-03-18 10:10:41 -04:00
|
|
|
Unload_Texture (Dragdown);
|
|
|
|
|
2024-03-18 08:06:11 -04:00
|
|
|
Close_Window;
|
|
|
|
|
|
|
|
end Window;
|