drawMarker
DRAW_MARKER0x28477EC23D892089The GTA V native DRAW_MARKER of the GRAPHICS namespace, as LS:MP client scripts call it: the global function drawMarker, in JavaScript and in Lua.
drawMarker(
type: number,
posX: number,
posY: number,
posZ: number,
dirX: number,
dirY: number,
dirZ: number,
rotX: number,
rotY: number,
rotZ: number,
scaleX: number,
scaleY: number,
scaleZ: number,
red: number,
green: number,
blue: number,
alpha: number,
bobUpAndDown: boolean,
faceCamera: boolean,
rotationOrder: number,
rotate: boolean,
textureDict: string,
textureName: string,
invert: boolean
): voiddrawMarker(
type: integer,
posX: number,
posY: number,
posZ: number,
dirX: number,
dirY: number,
dirZ: number,
rotX: number,
rotY: number,
rotZ: number,
scaleX: number,
scaleY: number,
scaleZ: number,
red: integer,
green: integer,
blue: integer,
alpha: integer,
bobUpAndDown: boolean,
faceCamera: boolean,
rotationOrder: integer,
rotate: boolean,
textureDict: string,
textureName: string,
invert: boolean
)Usage
drawMarker(
type, posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, red,
green, blue, alpha, bobUpAndDown, faceCamera, rotationOrder, rotate, textureDict, textureName,
invert
);drawMarker(
type, posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, red,
green, blue, alpha, bobUpAndDown, faceCamera, rotationOrder, rotate, textureDict,
textureName, invert
)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
drawMarker(
type, pos, dir, rot, scale, red, green, blue, alpha, bobUpAndDown, faceCamera, rotationOrder,
rotate, textureDict, textureName, invert
);drawMarker(
type, pos, dir, rot, scale, red, green, blue, alpha, bobUpAndDown, faceCamera,
rotationOrder, rotate, textureDict, textureName, invert
)Parameters
| Parameter | Type | JavaScript | Lua | Description |
|---|---|---|---|---|
type | int | number | integer | The marker type to draw. |
posX | float | number | number | The X coordinate to draw the marker at. |
posY | float | number | number | The Y coordinate to draw the marker at. |
posZ | float | number | number | The Z coordinate to draw the marker at. |
dirX | float | number | number | The X component of the direction vector for the marker, or 0.0 to use rotX/Y/Z. |
dirY | float | number | number | The Y component of the direction vector for the marker, or 0.0 to use rotX/Y/Z. |
dirZ | float | number | number | The Z component of the direction vector for the marker, or 0.0 to use rotX/Y/Z. |
rotX | float | number | number | The X rotation for the marker. Only used if the direction vector is 0.0. |
rotY | float | number | number | The Y rotation for the marker. Only used if the direction vector is 0.0. |
rotZ | float | number | number | The Z rotation for the marker. Only used if the direction vector is 0.0. |
scaleX | float | number | number | The scale for the marker on the X axis. |
scaleY | float | number | number | The scale for the marker on the Y axis. |
scaleZ | float | number | number | The scale for the marker on the Z axis. |
red | int | number | integer | The red component of the marker color, on a scale from 0-255. |
green | int | number | integer | The green component of the marker color, on a scale from 0-255. |
blue | int | number | integer | The blue component of the marker color, on a scale from 0-255. |
alpha | int | number | integer | The alpha component of the marker color, on a scale from 0-255. |
bobUpAndDown | BOOL | boolean | boolean | Whether or not the marker should slowly animate up/down. |
faceCamera | BOOL | boolean | boolean | Whether the marker should be a 'billboard', as in, should constantly face the camera. |
rotationOrder | int | number | integer | The order yaw, pitch and roll is applied. Usually 2. |
rotate | BOOL | boolean | boolean | Rotations only apply to the heading. |
textureDict | string | string | string | A texture dictionary to draw the marker with, or NULL. Example: 'GolfPutting' |
textureName | string | string | string | A texture name in textureDict to draw the marker with, or NULL. Example: 'PuttingMarker' |
invert | BOOL | boolean | boolean | Whether or not the marker should use an inverted depth test. |
Returns
Nothing. In JavaScript the call evaluates to undefined.
On LS:MP
type must be between 0 and 44; posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ must be finite numbers. Otherwise the call is ignored: nothing reaches the game, and no error is raised. A texture pair the game has not loaded, or empty strings, does not refuse the call: the marker is drawn without a texture.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Draws a marker with the specified appearance at the target location. This has to be called every frame.
Reference
- Namespace
- Graphics GRAPHICS
- In the game
void DRAW_MARKER(int type, float posX, float posY, float posZ, float dirX, float dirY, float dirZ, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ, int red, int green, int blue, int alpha, BOOL bobUpAndDown, BOOL faceCamera, int rotationOrder, BOOL rotate, const char* textureDict, const char* textureName, BOOL invert)- Hash
0x28477EC23D892089