-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.MeasureText
JoeStrout edited this page Apr 29, 2026
·
3 revisions
Measure string width for default font
| Parameter | Default Value | Note |
|---|---|---|
| text | ||
| fontSize | 20 |
| Condition | Return Value |
|---|---|
| (always) | number |
// Centre text horizontally on a 800-pixel-wide window
screenW = 800
msg = "Game Over"
w = raylib.MeasureText(msg, 40)
raylib.DrawText(msg, screenW - w) / 2, 300, 40, raylib.RED