WorldToScreen
Where a world point lands in the elements’ space.
Syntax
Section titled “Syntax”WorldToScreen(x, y, z)| Parameter | Type | |
|---|---|---|
x |
number | metres |
y |
number | metres |
z |
number | metres |
Returns
Section titled “Returns”number, number - the point’s place, or nil when it is behind the camera
Example
Section titled “Example”function OnFrame() local sx, sy = WorldToScreen(1240, 2130, 41) if sx then SetUiPos("flag", sx, sy - 40) ShowUiElement("flag") else HideUiElement("flag") endendSee also
Section titled “See also”GetScreenSize · OnFrame · the The game’s UI for a script group of the index
