diff options
| author | jussi | 2023-04-06 12:31:37 +0300 |
|---|---|---|
| committer | jussi | 2023-04-06 12:31:37 +0300 |
| commit | 2526c9732e7ea35bc9ed3e43a4db77b7e6364c5a (patch) | |
| tree | 825775577403d9341045571adb266173513c4bbd /examples/window/main.lua | |
| parent | 198a74c0aa27389c062c47bc29187c58a9d6c4a1 (diff) | |
| download | reilua-enhanced-2526c9732e7ea35bc9ed3e43a4db77b7e6364c5a.tar.gz reilua-enhanced-2526c9732e7ea35bc9ed3e43a4db77b7e6364c5a.tar.bz2 reilua-enhanced-2526c9732e7ea35bc9ed3e43a4db77b7e6364c5a.zip | |
All global variables and functions are not in global RL table. doc_parser creates also ReiLua_API.lua.
Diffstat (limited to 'examples/window/main.lua')
| -rw-r--r-- | examples/window/main.lua | 28 |
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 |
