# GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD

- **Hash:** `0xCB50D7AFCC8B0EC6`
- **Namespace:** GRAPHICS
- **Runtime name (Lua/JS):** `GetScreenCoordFromWorldCoord`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/GRAPHICS/GET_SCREEN_COORD_FROM_WORLD_COORD

## Signature

```c
BOOL GET_SCREEN_COORD_FROM_WORLD_COORD(float worldX, float worldY, float worldZ, float* screenX, float* screenY);
```

## Parameters

- `worldX` (`float`)
- `worldY` (`float`)
- `worldZ` (`float`)
- `screenX` (`float*`)
- `screenY` (`float*`)

## Returns

`BOOL`

## Usage

### Lua

```lua
local retval, screenX, screenY = GetScreenCoordFromWorldCoord(worldX, worldY, worldZ)

-- always available, by hash
local retval, screenX, screenY = Citizen.InvokeNative(0xCB50D7AFCC8B0EC6, worldX, worldY, worldZ, Citizen.PointerValueFloat(), Citizen.PointerValueFloat(), Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, screenX, screenY] = GetScreenCoordFromWorldCoord(worldX, worldY, worldZ);

// by hash
const [retval, screenX, screenY] = Citizen.invokeNative('0xCB50D7AFCC8B0EC6', worldX + 0.0000001, worldY + 0.0000001, worldZ + 0.0000001, Citizen.pointerValueFloat(), Citizen.pointerValueFloat(), Citizen.returnResultAnyway());
```

### C#

```csharp
var screenX = new OutputArgument();
var screenY = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xCB50D7AFCC8B0EC6, worldX, worldY, worldZ, screenX, screenY);
// screenX.GetResult<float>()
// screenY.GetResult<float>()
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.
- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.

*Sources: alloc8or RDR3 NativeDB.*
