- Documentation
- Client functions
- createGroundDecal
Function
createGroundDecal
New function!Added to Trilogy Hub on 2 Nov 2026.
Lays an image on the ground - a track, a stain or a place marker. The image follows slopes and kerbs instead of hanging flat above them. It is drawn up to 150 m from the camera, and with a lifetime set the last second fades out smoothly. The decal stays until destroyGroundDecal or until the resource stops.
Syntax
int createGroundDecal(string material, number x, number y, number z, number size [, number rotation = 0, int lifetime = 0, int color = white])Arguments
materialstring- A resource image path or a texture from dxCreateTexture.
xnumber- Centre X.
ynumber- Centre Y.
znumber- Height from which the ground is searched.
sizenumber- Square side in metres (0.1-50).
rotationnumber, optional = 0- Rotation in degrees.
lifetimeint, optional = 0- Lifetime in ms, 0 = until removed.
colorint, optional = white- Colour from tocolor.
Returns
Decal number or false.
Example
addCommandHandler("plama", function()
local x, y, z = getElementPosition(localPlayer)
createGroundDecal("img/plama.png", x, y, z, 2, math.random(0, 360), 30000, tocolor(255, 255, 255, 220))
end)
See also
destroyGroundDecalRemoves a decal made with createGroundDecal.setGroundDecalColorChanges the colour of a decal made with createGroundDecal.dxDrawMaterialLine3DDraws a material (an image, a texture, a browser, a camera or a shader) as a strip in the 3D world: from the start point (top of the image) to the end, with a given width. The strip faces the camera or thefaceX, faceY, faceZpoint. The drawing is part of the world: buildings hide it and it glows (a screen is visible at night). This is how you make a billboard, a cinema screen or a sign above a building.