summaryrefslogtreecommitdiff
path: root/examples/window/main.lua
diff options
context:
space:
mode:
authorjussi2024-02-25 14:06:59 +0200
committerjussi2024-02-25 14:06:59 +0200
commit47ed28b006db71d823cfaa24fa143ab5cfcf279b (patch)
treeadf35906662b0646a14adfa6a37260c797cd325a /examples/window/main.lua
parent631cea6aa7510ba53d4f14b5537e1719a72976b9 (diff)
downloadreilua-enhanced-47ed28b006db71d823cfaa24fa143ab5cfcf279b.tar.gz
reilua-enhanced-47ed28b006db71d823cfaa24fa143ab5cfcf279b.tar.bz2
reilua-enhanced-47ed28b006db71d823cfaa24fa143ab5cfcf279b.zip
Added various missing functions.
Diffstat (limited to 'examples/window/main.lua')
-rw-r--r--examples/window/main.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/window/main.lua b/examples/window/main.lua
index 99e8524..ec2377b 100644
--- a/examples/window/main.lua
+++ b/examples/window/main.lua
@@ -1,5 +1,6 @@
local textColor = RL.BLACK
local textPos = { 192, 200 }
+local textSize = 20
local text = "Congrats! You created your first window!"
function RL.init()
@@ -9,9 +10,9 @@ end
function RL.update( delta )
if RL.IsKeyPressed( RL.KEY_ENTER ) then
- local textSize = RL.MeasureText( RL.GetFontDefault(), text, 20, 2 )
local winSize = RL.GetScreenSize()
-
+
+ textSize = RL.MeasureText( text, textSize )
textColor = RL.BLUE
textPos = { winSize[1] / 2 - textSize[1] / 2, winSize[2] / 2 - textSize[2] / 2 }
end
@@ -24,5 +25,5 @@ end
function RL.draw()
RL.ClearBackground( RL.RAYWHITE )
- RL.DrawText( text, textPos, 20, textColor )
+ RL.DrawText( text, textPos, textSize, textColor )
end