SurfaceGuiBase

SurfaceGuiBase : LayerCollector

Overview

The SurfaceGuiBase class is an abstract base class for GUI containers that render 2D user interface elements (GuiObjects) on surfaces in the 3D game world. It serves as the foundation for specific classes like SurfaceGui, enabling developers to attach GUI elements to parts or models in the 3D environment.

Description

The SurfaceGuiBase class provides the core functionality required to render GUI elements on 3D surfaces, bridging the gap between 2D UI design and 3D spatial interaction. It includes properties and behaviors that allow developers to control how GUI elements are displayed and interact with the game world.

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)

Face

Enum.NormalId

Enum.NormalId

Face specifies which face of the 3D object the GUI will be displayed on. This property allows the developer to set the orientation of the GUI relative to the attached part or model in the 3D environment. Typical values for this property include Enum.NormalId.Front, Enum.NormalId.Back, Enum.NormalId.Top, Enum.NormalId.Bottom, Enum.NormalId.Left, or Enum.NormalId.Right. It ensures precise placement of GUI elements on the desired surface.

Code Samples

//NotWork//

Methods

Events