diff options
| author | xolatile | 2024-03-18 10:10:41 -0400 |
|---|---|---|
| committer | xolatile | 2024-03-18 10:10:41 -0400 |
| commit | c9066c44cf04dd459e9a6ff044c13317aa113625 (patch) | |
| tree | 0714f36e3ac3043d57ca04233e351d78086691e0 /window.adb | |
| parent | 1bf8f0fa756c2b34487c4323a3b9e04f1646e30b (diff) | |
| download | xolatile-raylib-ada-c9066c44cf04dd459e9a6ff044c13317aa113625.tar.xz xolatile-raylib-ada-c9066c44cf04dd459e9a6ff044c13317aa113625.tar.zst | |
More function bindings, debugging stuff...
Diffstat (limited to 'window.adb')
| -rw-r--r-- | window.adb | 37 |
1 files changed, 36 insertions, 1 deletions
@@ -3,20 +3,55 @@ use Raylib; procedure Window is + Text : String := "Heyo world!" & Character'Val (0); + + Dragdown : Texture; + + X : Integer := 120; + Y : Integer := 120; + begin Open_Window (720, 360, "Heyo Raylib!" & Character'Val (0)); + Set_Exit_Key (Key_Q); -- Default is Key_Escape + Set_Target_FPS (72); -- Default is 60 + + Dragdown := Load_Texture ("./texture.png" & Character'Val (0)); + Main_Loop: loop exit when Window_Should_Close; -- Begin_Drawing; -- - Clear_Background (Blue); + Clear_Background (Sky_Blue); + -- + Draw_Texture (Dragdown, (Get_Screen_Width - Dragdown.Width) / 2, (Get_Screen_Height - Dragdown.Height) / 2); + Draw_Texture (Dragdown, 100, 100, White); + Draw_Texture_Pro (Dragdown, (0.0, 0.0, 420.0, 420.0), (200.0, 0.0, 420.0, 420.0)); + --~Data : Texture := No_Texture; + --~Source : Rectangle := No_Rectangle; + --~Destination : Rectangle := No_Rectangle; + --~Origin : Vector_2D := (0.0, 0.0); + --~Rotation : Float := 0.0; + --~Tint : Color := White + Draw_Text ("Heyo world!" & Character'Val (0), 30, 30, 32, Light_Gray); + Draw_Text (Text, 30, 30, 32, Black); + 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, Red); + Draw_Rectangle (120, 120, 30, 60, Green); + Draw_FPS (X, Y); + 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; -- End_Drawing; end loop Main_Loop; + Unload_Texture (Dragdown); + Close_Window; end Window; |
