Skip to content

Frame ​

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


Класс PMUI.Frame ​

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

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

PMUI.Frame:new() ​

Creates a new frame element with default background and border settings.

Returns: PMUI.Frame

PMUI.Frame:SetTexture(textureOrPath) ​

Sets the frame background texture. String values are resolved through getTexture(), while texture objects are assigned directly.

ПараметрТипОписание
textureOrPathstring|Texture|nilTexture object or path to a texture.

Returns: PMUI.Frame

PMUI.Frame:SetBackgroundColor(r, g, b, a) ​

Sets the frame background color and controls background visibility.

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

PMUI.Frame:SetBorderColor(r, g, b, a) ​

Sets the frame border color and controls border visibility.

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

PMUI.Frame:SetCornerRadius(radius, topOnly) ​

Sets the corner radius used when rendering the frame. Optionally limits rounded corners to the top edge.

ПараметрТипОписание
radiusnumberCorner radius in pixels.
topOnlyboolean|nilWhether only the top corners should be rounded.

Returns: PMUI.Frame

PMUI.Frame:DrawRoundedBox(w, h, r, bgCol, borderCol, alphaMult) ​

Draws a frame with rounded corners using individual horizontal rectangles. Supports independently rounded top and bottom edges. Falls back to standard rectangle rendering when the radius is too small.

ПараметрТипОписание
wnumberFrame width.
hnumberFrame height.
rnumberRequested corner radius.
bgColtableBackground color components.
borderColtableBorder color components.
alphaMultnumberAdditional alpha multiplier, usually the frame's opacity.

PMUI.Frame:prerender() ​

Renders the frame background, texture, and border. Uses the configured texture when available, otherwise draws a solid-color background. Applies rounded corner rendering when a non-zero corner radius is configured.