-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetScreenToWorld2D
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Get the world space position for a 2d camera screen space position
| Parameter | Default Value | Note |
|---|---|---|
| position | ||
| camera |
| Condition | Return Value |
|---|---|
| (always) | map |
cam = {offset:[400,300], target:[0,0], rotation:0, zoom:2}
// Convert center of screen to world coordinates
worldPos = raylib.GetScreenToWorld2D([400, 300], cam)
print "World pos: " + worldPos[0] + ", " + worldPos[1]