dxDrawImageSection | Multi Theft Auto: Wiki Skip to content

dxDrawImageSection

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Differing from dxDrawImage, this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender).

Tip

Use a texture created with dxCreateTexture to speed up drawing .

Tip

To help prevent edge artifacts when drawing textures, set textureEdge to "clamp" when calling dxCreateTexture

Syntax

dxDrawImageSection ( )

Code Examples

client

Example 1The example draws a section of an image. (You can usethisimage to test.)

addEventHandler("onClientRender", root, function()
local sectionStartX, sectionStartY = 202, 65
local sectionWidth, sectionHeight = 150, 150
dxDrawImageSection(500, 500, 256, 256, sectionStartX, sectionStartY, sectionWidth, sectionHeight, "example.jpg")
end)