raylib-lua-legacy/examples/embedding/main.lua

24 lines
586 B
Lua
Raw Normal View History

local width, height = 800, 450
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
rl.InitWindow(800, 450, "raylib [shapes] example - basic shapes drawing")
2020-11-16 15:44:19 +00:00
rl.InitAudioDevice()
local logo = rl.LoadTexture "ressources/logo.png"
2020-11-16 15:44:19 +00:00
local music = rl.LoadSound "ressources/mini1111.ogg"
rl.PlaySound(music)
while not rl.WindowShouldClose() do
rl.BeginDrawing()
rl.ClearBackground(rl.RAYWHITE)
rl.DrawTexture(logo, width/2 - logo.width/2, height/2 - logo.height/2, rl.WHITE)
rl.DrawText("this is a texture!", 350, 370, 10, rl.GRAY)
rl.EndDrawing()
end
2020-11-16 15:44:19 +00:00
rl.CloseAudioDevice()
rl.CloseWindow()