Skip to main content

ScreenGui

This item only works when running on the client. Client

Utility for creating ScreenGui instances with sensible defaults. Automatically parents to PlayerGui at runtime, or to CoreGui when running inside a story environment.

Functions

new

ScreenGui.new(
namestring--

The name to assign to the ScreenGui

) → ScreenGui

Creates a new ScreenGui with ResetOnSpawn disabled and ZIndexBehavior set to Sibling, then parents it to PlayerGui.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new `ScreenGui` with `ResetOnSpawn` disabled and\n`ZIndexBehavior` set to `Sibling`, then parents it to `PlayerGui`.",
            "params": [
                {
                    "name": "name",
                    "desc": "The name to assign to the ScreenGui",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ScreenGui"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 40,
                "path": "src/client/core/lib/UI/ScreenGui.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ScreenGui",
    "desc": "Utility for creating `ScreenGui` instances with sensible defaults.\nAutomatically parents to `PlayerGui` at runtime, or to `CoreGui` when\nrunning inside a story environment.",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 17,
        "path": "src/client/core/lib/UI/ScreenGui.luau"
    }
}