Skip to content

Image ​

Require path: require "ProjectMotionUI/Components/Image"


Class PMUI.Image ​

Inherits from: PMUI.BaseElement

Methods & Functions ​

PMUI.Image:new(textureOrPath) ​

Creates a new image element using the specified texture.

ParameterTypeDescription
textureOrPathstring|Texture|nilTexture object or path to a texture.

Returns: PMUI.Image

PMUI.Image:SetTexture(textureOrPath) ​

Sets the image texture. String values are resolved through getTexture(), while texture objects are assigned directly. Automatically adopts the texture dimensions when the element still uses its default size.

ParameterTypeDescription
textureOrPathstring|Texture|nilTexture object or path to a texture.

Returns: PMUI.Image

PMUI.Image:SetTint(r, g, b, a) ​

Sets the color tint applied to the image texture.

ParameterTypeDescription
rnumberRed component (0.0-1.0).
gnumberGreen component (0.0-1.0).
bnumberBlue component (0.0-1.0).
anumber|nilAlpha component (0.0-1.0), defaults to 1.0.

Returns: PMUI.Image

PMUI.Image:prerender() ​

Renders the image texture scaled to the element's current dimensions. Applies the configured tint color and combines its alpha with the element opacity.