SET_DRAW_ORIGIN
Sets the on-screen drawing origin for draw-functions in world coordinates.
Signature
void SET_DRAW_ORIGIN(float x, float y, float z, BOOL is2d);Parameters
| Name | Type | Description |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
is2d | BOOL | — |
Returns void
Description
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
SetDrawOrigin(x, y, z, is2d)
-- always works, by hash
Citizen.InvokeNative(0xe10198d5, x, y, z, is2d)JavaScript and C#
SetDrawOrigin(x, y, z, is2d);
// by hash
Citizen.invokeNative('0xe10198d5', x + 0.0000001, y + 0.0000001, z + 0.0000001, is2d);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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
See also
CLEAR_DRAW_ORIGINResets the screen's draw-origin which was changed by the function SET_DRAW_ORIGIN back to x=0, y=0.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.