Astrath:createImage

From Multi Theft Auto: Wiki
Revision as of 19:59, 22 October 2025 by Sybellex (talk | contribs) (Created page with "= DxImage:new = {{Client function}} {{FuncDef|element DxImage:new ( string path, float posX, float posY, float width, float height, element parent, boolean relative )}} '''Description:''' Creates a DX image element. An image element displays a static image from a file on the screen. '''Parameters:''' path (string) – Path to the image file (must exist). posX, posY (float) – Position on screen. width, height (float) – Size of the image. parent (element) – P...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

DxImage:new

Template:FuncDef

Description: Creates a DX image element. An image element displays a static image from a file on the screen.

Parameters:

path (string) – Path to the image file (must exist).

posX, posY (float) – Position on screen.

width, height (float) – Size of the image.

parent (element) – Parent DX element (optional).

relative (boolean) – Position relative to parent (optional).

Returns:

Returns the newly created DxImage element.

Methods:

Method Description

Ath:setVisible(boolean) - Ath:setEnabled(boolean) - Ath:setAlpha(int) - Ath:setPath(string path) - Ath:destroy() }

Example:

local img = DxImage:new("images/logo.png", 100, 100, 200, 150)
img:setAlpha(200)
img:setVisible(true)