RedM Natives

SET_DRAW_ORIGIN

Sets the on-screen drawing origin for draw-functions in world coordinates.

Hash0xE10198D5
Runtime nameSetDrawOrigin
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

void SET_DRAW_ORIGIN(float x, float y, float z, BOOL is2d);

Parameters

NameTypeDescription
xfloat—
yfloat—
zfloat—
is2dBOOL—

Returns void

Description

Cfx.re native reference

Sets the on-screen drawing origin for draw-functions in world coordinates.

The effect can be reset by calling CLEAR_DRAW_ORIGIN and is limited to 32 different origins each frame.

Usage

Lua
SetDrawOrigin(x, y, z, is2d)

-- always works, by hash
Citizen.InvokeNative(0xe10198d5, x, y, z, is2d)
JavaScript and C#
JavaScript
SetDrawOrigin(x, y, z, is2d);

// by hash
Citizen.invokeNative('0xe10198d5', x + 0.0000001, y + 0.0000001, z + 0.0000001, is2d);
C#
Function.Call((Hash)0xe10198d5, x, y, z, is2d);
  • 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.

See also

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.