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

Function

dxDrawImage

ClientDrawing (dx)Identical to MTA:SA

Draws an image (a resource PNG/JPG file, a texture, a render target, a browser or a camera) in a screen rectangle, with optional rotation and tint.

Syntax

bool dxDrawImage(float posX, float posY, float width, float height, string|element image [, float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = tocolor(255, 255, 255), bool postGUI = false])

Arguments

posXfloat
Left edge.
posYfloat
Top edge.
widthfloat
Width.
heightfloat
Height.
imagestring|element
A file path or a material.
rotationfloat, optional = 0
Rotation in degrees.
rotationCenterOffsetXfloat, optional = 0
Rotation centre offset X.
rotationCenterOffsetYfloat, optional = 0
Rotation centre offset Y.
colorint, optional = tocolor(255, 255, 255)
Tint and transparency.
postGUIbool, optional = false
Above GUI.

Returns

true if drawn.

Example

addEventHandler("onClientRender", root, function()
    dxDrawImage(20, 20, 128, 128, "img/logo.png", getTickCount() / 20 % 360)
end)

See also