M MY Multiplayer: Wiki
Side
Kind

dxDrawImage

Client

Draws an image on the screen for one frame.

bool dxDrawImage(float x, y, float width, height, texture|dui|string image [, float rotation = 0, float rotationCenterOffsetX, rotationCenterOffsetY = 0, 0, color color = tocolor(255, 255, 255), bool postGUI = false])

Parameters

NameTypeDescription
x, yfloatTop-left corner on the screen, in pixels. A vec2 also works.
width, heightfloatSize on the screen, in pixels. A vec2 also works.
imagetexture|dui|stringThe image (a texture, render target, screen source or dui) or the path of an image file in the resource.
rotationfloatRotation in degrees, clockwise.default 0
rotationCenterOffsetX, rotationCenterOffsetYfloatOffset of the rotation centre from the image's centre, in pixels. A vec2 also works.default 0, 0
colorcolorColour multiplied with the image, a tocolor value.default tocolor(255, 255, 255)
postGUIboolDraw on top of the interface.default false

Returns

true once the drawing is queued, false when the image could not be loaded.

A path is loaded once and kept for later calls. While the file is still loading, nothing is drawn.

Example

local sx, sy = getScreenSize()

addEventHandler("onClientRender", root, function()
    dxDrawImage(sx - 140, 20, 120, 120, "images/logo.png", getTickCount() / 20 % 360)
end)

See also