diff options
| author | jussi | 2024-03-17 10:38:30 +0200 |
|---|---|---|
| committer | jussi | 2024-03-17 10:38:30 +0200 |
| commit | ae1d0b65f16b24f2e0db39cb8baef4af57b2a12f (patch) | |
| tree | 80358810635da19821bdb38ece2098c2dd48f1ff /examples/window/main.lua | |
| parent | ca238975dc63d2dddcd2b17ad627bedc95dd158c (diff) | |
| download | reilua-enhanced-ae1d0b65f16b24f2e0db39cb8baef4af57b2a12f.tar.gz reilua-enhanced-ae1d0b65f16b24f2e0db39cb8baef4af57b2a12f.tar.bz2 reilua-enhanced-ae1d0b65f16b24f2e0db39cb8baef4af57b2a12f.zip | |
Round and pubsub lib.
Diffstat (limited to 'examples/window/main.lua')
| -rw-r--r-- | examples/window/main.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/window/main.lua b/examples/window/main.lua index ec2377b..77ac64c 100644 --- a/examples/window/main.lua +++ b/examples/window/main.lua @@ -11,10 +11,10 @@ end function RL.update( delta ) if RL.IsKeyPressed( RL.KEY_ENTER ) then local winSize = RL.GetScreenSize() + local measuredSize = RL.MeasureTextEx( RL.GetFontDefault(), text, textSize, 2 ) - textSize = RL.MeasureText( text, textSize ) textColor = RL.BLUE - textPos = { winSize[1] / 2 - textSize[1] / 2, winSize[2] / 2 - textSize[2] / 2 } + textPos = { winSize[1] / 2 - measuredSize[1] / 2, winSize[2] / 2 - measuredSize[2] / 2 } end if RL.IsKeyPressed( RL.KEY_SPACE ) then @@ -25,5 +25,5 @@ end function RL.draw() RL.ClearBackground( RL.RAYWHITE ) - RL.DrawText( text, textPos, textSize, textColor ) + RL.DrawText( text, textPos, textSize, textColor ) end |
