From 47ed28b006db71d823cfaa24fa143ab5cfcf279b Mon Sep 17 00:00:00 2001 From: jussi Date: Sun, 25 Feb 2024 14:06:59 +0200 Subject: Added various missing functions. --- examples/window/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/window') 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 -- cgit v1.2.3