You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JoeStrout edited this page Apr 29, 2026
·
3 revisions
Measure string width for default font
Parameters
Parameter
Default Value
Note
text
fontSize
20
Return value
Condition
Return Value
(always)
number
Notes
Example
// Centre text horizontally on a 800-pixel-wide windowscreenW=800msg="Game Over"w=raylib.MeasureText(msg, 40)
raylib.DrawText(msg, screenW-w) /2, 300, 40, raylib.RED