SurfaceGuiBase
SurfaceGuiBase : LayerCollector
Overview
Properties
Active
bool
Active is a boolean property controlling the visibility or enablement of the widget component, representing whether it is currently active.
Code Samples
Adornee
Instance
specifies the part or model to which the GUI is attached.
Code Samples
local SurfaceGui = script.Parent
print(SurfaceGui.Adornee)
AlwaysOnTop
bool
AlwaysOnTop determines whether the GUI element remains on top of other elements.
Code Samples
local SurfaceGui = script.Parent
print(SurfaceGui.AlwaysOnTop)
LightInfluence
number
Adjusts how much the GUI is affected by lighting in the game world.
Code Samples
local SurfaceGui = script.Parent
print(SurfaceGui.LightInfluence)
Brightness
number
Controls the brightness level of the GUI, ranging from 0 to 10. Higher values make the GUI appear to emit light, though this effect is purely visual and does not produce actual lighting or shadows.
Code Samples
MaxDistance
number
Controls the maximum distance from which the SurfaceGui
can be seen, allowing developers to optimize performance by limiting rendering distance.
Code Samples
local SurfaceGui = script.Parent
print(SurfaceGui.MaxDistance)
Size
UDim2
Defines the size of the GUI element. For SurfaceGui
, the size is determined by its Adornee and cannot be modified manually. In contrast, BillboardGui
allows the Size property to be adjusted directly.
Code Samples
ClipsDescendants
bool
Determines whether GUI elements that extend beyond the bounds of their parent canvas are rendered. For example, if ClipsDescendants
is set to false
, a GuiObject
under a SurfaceGui
will continue to render even when it extends beyond the boundaries of the Adornee part.
Code Samples
ZIndexBehavior
EZIndexMode
ZIndexBehavior
controls how UI elements are layered across SurfaceGui
instances.When set to Sibling
, the ZIndex is applied only within the same SurfaceGui
. When set to Global
, ZIndex values are compared across multiple SurfaceGui
instances to determine the overall render order.This is useful when UI elements span across multiple SurfaceGuis
and need precise front-to-back layering.
Code Samples
Methods
Events
Last updated