For the complete documentation index, see llms.txt. This page is also available as Markdown.

GUI

Overview

GUI refers to graphical elements within the game that allow interaction with players. Using GUI, you can add various elements such as buttons, text, images, and progress bars to the game screen.

GUI Types

Object
Description

ScreenGui

An object used to display 2D-based elements on the screen. 2D objects such as Frame, TextButton, ImageButton, etc., must be children of Gui objects such as ScreenGui/SurfaceGui objects to be rendered. ScreenGui itself does not display any information.

SurfaceGui

An object used to display 2D UI in a 3D space. Attaches GUI elements to in-game surfaces or objects for interactive purposes.

BillboardGui

BillboardGui is an object that displays 2D UI in 3D space, always facing the camera. Because it constantly rotates to align with the player's view, it's commonly used for elements like name tags, health bars, and dialogue boxes.

Frame

A 2D object used for designing layouts or grouping elements such as TextLabel, TextButton, ImageLabel, ImageButton.

ScrollingFrame

A 2D-based object that provides a scrollable layout. It enables all contained objects to be displayed on screen through scrolling functionality.

TextLabel

An object that displays text.

ImageLabel

An object that displays images.

TextButton

A button that displays text.

ImageButton

A button that displays images.

UIAspectRatioConstraint

Provides the functionality to set the aspect ratio of 2D-based objects. If you want to set the aspect ratio for objects like Frame, ImageLabel, ImageButton, or TextButton, you can add a UIAspectRatioConstraint as a child and adjust the ratio. The ratio will be maintained based on the current size of the parent object.

UIListLayout

An object that arranges child objects within a parent object in a list format, evenly spaced.

UIGridLayout

An object that arranges child objects within a parent in a grid format, using consistent sizes and spacing.

UIStroke

An object that displays a stroke along the border of its parent UI object or around its text. You can configure properties such as the stroke color, thickness, transparency, position, and corner join style to emphasize UI elements or improve their visibility.

ProgressBar

An object that visually displays the current progress or value. It can be used to create horizontal, vertical, circular, and semicircular gauges, with the fill ratio set through the Value property.

ScreenGui Properties

Property
Description

Enabled

Determines whether all child objects of the ScreenGui are displayed on the screen.

DisplayOrder

Determines which ScreenGui will be displayed on top of the screen. Higher value indicates higher priority, making the ScreenGui appear above others.

SurfaceGui Properties

Property
Description

Enabled

Determines whether all child objects of the SurfaceGui are displayed on the screen.

Always on Top

Ensures that the SurfaceGui is always rendered on top of other 3D objects.

Light Influence

Controls how much the SurfaceGui is affected by lighting.

Max Distance

Sets the maximum distance at which the SurfaceGui remains visible to the player.

Active

Determines whether UI elements within the SurfaceGui, such as buttons and text boxes, can process clicks, touches, or keyboard input.

Adornee

Specifies the object on which the SurfaceGui is rendered.

Face

Determines which face of the part the GUI is displayed on.

BillboardGui Properties

Property
Description

Enabled

Controls whether all objects parented to a BillboardGui are visible on the screen.

Always on Top

Sets the BillboardGui to always render on top of other 3D objects.

Light Influence

Specifies how much the BillboardGui is affected by lighting.

Brightness

Sets the brightness applied to the BillboardGui. Higher values make it appear brighter, which is useful for visual emphasis without interaction with 3D lighting. (This can be set only when Light Influence is less than 1.)

Max Distance

Sets the maximum distance at which the BillboardGui remains visible to the player.

Distance Lower Limit

Sets the distance at which the BillboardGui stops scaling up when it gets too close to the player's camera.

Distance Upper Limit

Sets the distance at which the BillboardGui stops scaling down when it gets too far from the player's camera.

Active

Determines whether UI elements within the BillboardGui, such as buttons and text boxes, can process clicks, touches, or keyboard input.

Adornee

Specifies the object on which the BillboardGui is rendered.

Clips Descendants

Specifies whether child UI elements are clipped when they extend beyond the boundaries of the parent GUI. If true, any elements outside the boundaries will not be visible.

Size

Sets the size of BillboardGui.

Position Offset

Sets the offset from rendering object based on camera.

Position Offset World Space

Sets the offset from rendering object based on target object.

Extents Offset World Space

Sets the offset from the rendered object in world coordinates. (The value's unit is based on half the size of the model) Adjusts the position of the BillboardGui based on the target's size (Extents). This is useful for naturally placing UI elements such as health bars above characters, as the position automatically adapts to different model sizes. The offset is applied along the target's axes (the parent Part or Adornee) by multiplying the input value (Vector3) with half of the bounding box length (Extents) on each axis.

Size Offset

Sets the offset from rendering object based on screen plane.

Gui Element Properties

Common Properties

Property
Description

Position

Defines the position of the object on the screen.

It uses the UDim2 format, where you can input ScaleX, OffsetX, ScaleY, and OffsetY in order.

  • Scale: A ratio between 0.0 and 1.0, where 0.1 represents 10%.

  • Offset: Set in pixels, where 10 represents 10 pixels.

The Scale and Offset values are combined to determine the on-screen position. For example, if ScaleX is 0.25 and OffsetX is 10, the object will move 25% to the right from the Anchor Point (the center point of the Frame) and an additional 10 pixels to the right.

Rotation

Adjusts the rotation angle of the object, where 360.0 represents 360 degrees.

Size

Defines the size of the object. Uses the UDim2 format similar to Position.

Visible

Determines whether the object is visible or hidden.

Anchor Point

Defines the object's anchor point. It uses a Vector2 format, and the default (0.0, 0.0) sets the top-left corner as the anchor point.

ZIndex

Determines the stacking order of UI elements. If FrameA is obscured by FrameB, you can use the ZIndex value to ensure FrameA appears above FrameB.

Clips Descendants

Clips Descendants: This property determines whether to display the clipped area on the screen if a child UI element clips its parent's UI area.

Frame

Property
Description

Border Pixel Size

Defines the thickness of the frame's border.

Border Mode

A property that determines how the border is displayed relative to the Frame's edge. You can set it to Insert (inside), Middle (center), or Outline (outside).

Border Color 3

Sets the color of the border.

Background Color 3

Sets the background color of the frame.

Background Trnasparency

Adjusts the background transparency of the frame.

TextLabel

Property
Description

Text

Allows you to input the text to be displayed.

Text Scaled

Automatically adjusts the text size to fit the object's size, ignoring the Text Size value.

Font Face

Specifies the font applied to the displayed text. Clicking the field displays the list of available fonts, and Style and Weight are provided as sub-fields.

  • Style : Specifies whether the text is displayed in bold or italic

  • Weight : Specifies the thickness of the text

Text Size

Defines the size of the displayed text in pixels.

Text Color 3

Sets the color of the displayed text.

Text Transparency

Adjusts the transparency of the displayed text.

Background Color 3

Sets the background color.

Background Transparency

Adjusts the background transparency.

ImageLabel

Property
Description

Image

Sets the AssetId of the image to be displayed. You can use the AssetId of an image registered in the Asset Manager or Asset Store.

Image Transparency

Adjusts the transparency of the image.

Scale Type

Specifies how the image is scaled when the size of the UI element differs from the original image.

  • Stretch : Stretches the image to fit the element.

  • Slice : Divides the image into nine regions for scaling.

Slice Center

Specifies the boundaries of the nine regions when ScaleType is Slice. The value is a pixel coordinate based on the top-left corner of the image, entered as four fields X0, Y0, X1, and Y1.

Slice Scale

Specifies the scale factor applied to the edges when ScaleType is Slice.

Background Color 3

Sets the background color.

Background Transparency

Adjusts the background transparency.

TextButton

Property
Description

Text

Allows you to input the text to be displayed.

Text Scaled

Automatically adjusts the text size to fit the object's size, ignoring the Text Size value.

Font Face

Specifies the font applied to the displayed text. Clicking the field displays the list of available fonts, and Style and Weight are provided as sub-fields.

  • Style : Specifies whether the text is displayed in bold or italic

  • Weight : Specifies the thickness of the text

Text Size

Defines the size of the displayed text in pixels.

Text Color 3

Sets the color of the displayed text.

Text Transparency

Adjusts the transparency of the displayed text.

Background Color 3

Sets the background color.

Background Transparency

Adjusts the background transparency.

ImageButton

Property
Description

Image

Sets the AssetId of the image to be displayed. You can use the AssetId of an image registered in the Asset Manager or Asset Store.

Image Transparency

Adjusts the transparency of the image.

Scale Type

Specifies how the image is scaled when the size of the UI element differs from the original image.

  • Stretch : Stretches the image to fit the element.

  • Slice : Divides the image into nine regions for scaling.

Slice Center

Specifies the boundaries of the nine regions when ScaleType is Slice. The value is a pixel coordinate based on the top-left corner of the image, entered as four fields X0, Y0, X1, and Y1.

Slice Scale

Specifies the scale factor applied to the edges when ScaleType is Slice.

Background Color 3

Sets the background color.

Background Transparency

Adjusts the background transparency.

UIAspectRatioConstraint

When the size of an ImageLabel is set to { 0.5, 0, 0.5, 0 }, or 50% of the client device’s size on both the X and Y axes, adding a UIAspectRatioConstraint as a child and setting its Aspect Ratio property to 1.0 ensures the ImageLabel maintains a 1:1 ratio. This prevents the image from stretching horizontally or vertically.

Property
Description

Aspect Ratio

Sets the desired ratio of the parent object. The default value is 1.0, where the X and Y axes maintain a 1:1 ratio.

Aspect Type

Determines how the UI element maintains its aspect ratio.

  • FitWithinMaxSize : The UI element maintains its ratio while shrinking within the maximum size

  • ScaleWithParentSize : The UI element adjusts its ratio based on the parent's size

  • SizeRelativeXY : Maintains relative size in both the X and Y directions

Dominant Axis

Determines which axis to prioritize when maintaining the ratio as the UI size changes.

  • Width : Adjusts the height based on the width.

  • Height : Adjusts the width based on the height.

ScrollingFrame

Property
Description

AutomaticCanvasSize

Determines whether to automatically adjust the CanvasSize based on the size of child objects.

  • None: No automatic adjustment

  • X: Automatic adjustment in the horizontal direction

  • Y: Automatic adjustment in the vertical direction

  • XY: Automatic adjustment in both horizontal and vertical directions

CanvasSize

This property sets the size of the scrollable inner area.

CanvasPosition

This property allows manual setting or checking of the scroll position.

ScrollBarImageColor3

This property sets the image color of the scrollbar.

ScrollBarImageTransparency

This property sets the image transparency of the scrollbar.

ScrollBarThickness

This property sets the width of the scrollbar in pixels.

ScrollingDirection

This property sets the scroll direction.

  • X: Horizontal scroll

  • Y: Vertical scroll

  • XY: Both horizontal and vertical scroll

ScrollingEnabled

This property enables or disables the scrolling function.

UIListLayout

Property
Description

Padding

Specifies the spacing between UI elements.

Wraps

This property determines whether to automatically wrap to the next line.

FillDirection

Specifies the direction in which UI elements are arranged.

  • Horizontal: Arranged horizontally

  • Vertical: Arranged vertically

SortOrder

Specifies the way UI elements are sorted.

  • LayoutOrder: Sorts by LayoutOrder value for each instance

  • Name: Sorts by name

HorizontalAlignment

Specifies the horizontal alignment.

  • Left: Align left

  • Center: Center

  • Right: Align right

VerticalAlignment

Specifies the vertical alignment.

  • Top: Top align

  • Center: Center

  • Bottom: Bottom align

UIGridLayout

Property
Description

CellPadding

Specifies the spacing between cells.

CellSize

Specifies the size of a cell.

FillDirectionMaxCells

Specifies the maximum number of cells to be filled in the specified direction.

FillDirection

Specifies the direction in which UI elements are arranged.

  • Horizontal: Arranged horizontally

  • Vertical: Arranged vertically

SortOrder

Specifies the way UI elements are sorted.

  • LayoutOrder: Sorts by LayoutOrder value for each instance

  • Name: Sorts by name

HorizontalAlignment

Specifies the horizontal alignment.

  • Left: Align left

  • Center: Center

  • Right: Align right

VerticalAlignment

Specifies the vertical alignment.

  • Top: Top align

  • Center: Center

  • Bottom: Bottom align

UIStroke

프로퍼티
설명

ApplyStrokeMode

Determines how the stroke is applied.

  • Border: Displays the stroke along the border of the parent UI object.

  • Contextual: Displays the stroke according to the type of the parent UI object.

BorderOffset

Determines the horizontal and vertical offset of the stroke from the border of the parent UI object.

BorderStrokePosition

Determines where the stroke is displayed relative to the border of the parent UI object.

  • Inner: Displays the stroke inside the border.

  • Center: Displays the stroke centered on the border.

  • Outer: Displays the stroke outside the border.

Color

Determines the color of the stroke.

LineJoinMode

Determines how stroke segments are joined at corners.

  • Round: Joins corners with a rounded shape.

  • Bevel: Joins corners with a beveled shape.

  • Miter: Joins corners with a pointed shape.

StrokeSizingMode

Determines how the stroke thickness is calculated when the size of the UI object changes.

  • FixedSize: Maintains a constant thickness regardless of the UI object’s size.

  • ScaledSize: Adjusts the thickness in proportion to the UI object’s size.

Thickness

Determines the thickness of the stroke. A higher value displays a thicker stroke.

Transparency

Determines the transparency of the stroke. A value closer to 0 makes the stroke more opaque, while a value closer to 1 makes it more transparent.

ZIndex

Determines the display priority of the stroke when it overlaps other UI objects. A higher value displays the stroke in front of objects with lower values.

9-Slice Editor

Stretch applied
9-Slice applied

9-Slice is a feature that divides a single image into nine regions so that the corners and edges are not stretched even when the size of the UI element changes. It can be used with Image Label and Image Button, and is applied identically not only to ScreenGui but also to GUIs in 3D space such as BillboardGui and SurfaceGui.

How to Use

Click the … button to open the 9-Slice Editor.
9-Slice Editor
  1. Add an Image Label or Image Button and enter the Asset Id of the image to display in the Image property.

  2. Set Scale Type to Slice. When set to Slice, the Slice Center and Slice Scale properties are displayed.

  3. Specify the boundaries of the nine regions with Slice Center. You can enter the value directly in the Properties window, or specify it in the 9-Slice editor by clicking the ··· button in the Slice Center field.

  4. Adjust the scale factor of the edges with Slice Scale as needed.

ProgressBar

프로퍼티
설명

Value

Sets the ratio of the filled area. Values range from 0 to 1, where 0 represents an empty state and 1 represents a fully filled state.

FillDirection

Sets the direction in which the filled area expands according to the Value. Supports horizontal, vertical, center-expanding, circular, and semicircular gauges.

StartAngle

Sets the starting angle of the filled area for circular or semicircular ProgressBars. The value ranges from 0 to 360 degrees.

ArcSize

Sets the arc range of a circular or semicircular ProgressBar. A value of 360 represents a circle, while a value of 180 or less can be used to represent a semicircle.

TrackImage

Sets the AssetId of the image displayed in the background area of the ProgressBar.

TrackTransparency

Sets the transparency of the background area. Values closer to 0 appear more opaque, while values closer to 1 appear more transparent.

TrackColor3

Sets the color of the background area.

TrackCornerRadius

Sets the corner radius of the background area. This property can be used with linear fill modes; higher values produce more rounded corners.

FillImage

Sets the AssetId of the image displayed in the filled area of the ProgressBar.

FillTransparency

Sets the transparency of the filled area. Values closer to 0 appear more opaque, while values closer to 1 appear more transparent.

FillColor3

Sets the color of the filled area.

FillCornerRadius

Sets the corner radius of the filled area. This property can be used with linear fill modes; higher values produce more rounded corners on the filled area.

CornerClipEnabled

Sets the fill behavior of a linear ProgressBar with rounded corners. When set to true, the filled area is simply clipped. When set to false, the corner radius is preserved while the area is filled.

Last updated