---
title: "SurfaceGui"
description: "A GUI container rendered onto a selected face of a Part or SpawnLocation."
canonical: "https://docs.glorpia.com/instances/surfacegui"
markdown: "https://docs.glorpia.com/instances/surfacegui.md"
---
# SurfaceGui

A GUI container rendered onto a selected face of a Part or SpawnLocation.

**Category:** Instances

## Properties

| Name | Type | Description |
| --- | --- | --- |
| `Enabled` | boolean | Controls whether the SurfaceGui renders and receives GUI input. Default: true. |
| `AlwaysOnTop` | boolean | When true, draws above world geometry. Default: false. |
| `AbsoluteSize` | Vector2 | Read-only logical pixel size derived from the selected part face and PixelsPerStud. |
| `Face` | Enum.NormalId | Part face used by the GUI. Default: Enum.NormalId.Front. |
| `PixelsPerStud` | number | Render density in logical pixels per stud on the selected face. Default: 100. |
| `MaxDistance` | number | Maximum camera distance at which the GUI renders. Default: 1000. |

## Hierarchy and rendering

A SurfaceGui is active when directly parented to a `Part` or `SpawnLocation` in Workspace. It follows that part's transform and selected face.

`AbsoluteSize` is calculated from the selected face dimensions multiplied by `PixelsPerStud`. SurfaceGui has no authored CanvasSize. A density of 100 PixelsPerStud is the authored pixel baseline. Increasing PixelsPerStud raises render density while fixed pixel offsets, border widths, corner offsets and non-scaled TextSize retain the same physical size on the part. TextScaled also uses the higher-density canvas instead of shrinking at high PixelsPerStud values. Frame, TextLabel and TextButton visuals use the shared Skia 2D renderer; the finished layers are perspective-correctly sampled on angled part faces. UIBlur can blur the local 3D backdrop behind a child GUI object while the foreground remains sharp. TextButton pointer signals use the same density-aware projected layout for hit testing.

> **Note:** Hierarchy parenting is unrestricted. A SurfaceGui in another context stays in the hierarchy but does not render. With `AlwaysOnTop = false`, it participates in 3D BlurEffect/ColourCorrection; with `AlwaysOnTop = true`, it is composited afterward and bypasses those effects while remaining below ScreenGui.

## Example

```luau
local gui = Instance.new("SurfaceGui")
gui.Face = Enum.NormalId.Front
gui.PixelsPerStud = 100
print(gui.AbsoluteSize)
gui.MaxDistance = 150
gui.Parent = workspace.Sign

local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 1, 0)
label.TextScaled = true
label.Text = "Glorpia"
label.Parent = gui
```

## Related

- [ScreenGui](https://docs.glorpia.com/instances/screengui.md) — Screen-space GUI container.
- [BillboardGui](https://docs.glorpia.com/instances/billboardgui.md) — Camera-facing world-space GUI container.
- [TextButton](https://docs.glorpia.com/instances/textbutton.md) — Interactive text GUI object.
