ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. dxSetTextureEdge

Function

dxSetTextureEdge

ClientDrawing (dx)Identical to MTA:SA

Sets what a texture shows outside its image in sections (dxDrawImageSection): repeat (wrap), mirror (mirror), stretched edge (clamp) or a border colour (border).

Syntax

bool dxSetTextureEdge(element theTexture, string textureEdge [, int borderColor])

Arguments

theTextureelement
The texture.
textureEdgestring
"wrap", "mirror", "clamp", "border".
borderColorint, optional
Border colour for border.

Returns

true on success.

Example

A tiled background: a section bigger than the texture repeats it.

local tile = dxCreateTexture("img/kafel.png")
dxSetTextureEdge(tile, "wrap")
addEventHandler("onClientRender", root, function()
    dxDrawImageSection(0, 0, 512, 512, 0, 0, 512, 512, tile)
end)

See also