Skip to content

Image ​

Путь подключения: require "ProjectMotionUI/Components/Image"


Класс PMUI.Image ​

Наследуется от: PMUI.BaseElement

Методы и функции ​

PMUI.Image:new(textureOrPath) ​

Creates a new image element using the specified texture.

ПараметрТипОписание
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.

ПараметрТипОписание
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.

ПараметрТипОписание
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.