summaryrefslogtreecommitdiff
path: root/examples/window/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/window/main.lua')
-rw-r--r--examples/window/main.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/window/main.lua b/examples/window/main.lua
index 1fa5744..9816188 100644
--- a/examples/window/main.lua
+++ b/examples/window/main.lua
@@ -1,29 +1,29 @@
-local textColor = BLACK
+local textColor = RL.BLACK
local textPos = { 192, 200 }
local imageFont = -1
local text = "Congrats! You created your first window!"
-function init()
- RL_SetWindowTitle( "First window" )
- RL_SetWindowState( FLAG_VSYNC_HINT )
+function RL.init()
+ RL.SetWindowTitle( "First window" )
+ RL.SetWindowState( RL.FLAG_VSYNC_HINT )
end
-function process( delta )
- if RL_IsKeyPressed( KEY_ENTER ) then
- local textSize = RL_MeasureText( 0, text, 20, 2 )
- local winSize = RL_GetScreenSize()
+function RL.process( delta )
+ if RL.IsKeyPressed( RL.KEY_ENTER ) then
+ local textSize = RL.MeasureText( 0, text, 20, 2 )
+ local winSize = RL.GetScreenSize()
- textColor = BLUE
+ textColor = RL.BLUE
textPos = { winSize[1] / 2 - textSize[1] / 2, winSize[2] / 2 - textSize[2] / 2 }
end
- if RL_IsKeyPressed( KEY_SPACE ) then
- textColor = BLACK
+ if RL.IsKeyPressed( RL.KEY_SPACE ) then
+ textColor = RL.BLACK
textPos = { 192, 200 }
end
end
-function draw()
- RL_ClearBackground( RAYWHITE )
- RL_DrawText( 0, text, textPos, 20, 2, textColor )
+function RL.draw()
+ RL.ClearBackground( RL.RAYWHITE )
+ RL.DrawText( 0, text, textPos, 20, 2, textColor )
end