Skip to main content

GuiManager

GuiManager is a singleton class that manages the mounting and unmounting of GuiObjects to the PlayerGui. It is intended to be used as a singleton and should be accessed via FusionOnRails.GuiManager. This is not meant to be a replacement for dedicated UI frameworks, but rather a way to easily manage UIs that are not complex enough to warrant a dedicated framework.

[API][CLASS PROPS] .ScreenGui: ScreenGui

[OBJECT SIGNALS]
	:GetSignal("Mounted") -> Signal<GuiObject, string>

[OBJECT METHODS]
	:Mount(gui: GuiObject, name: string?)
	:Unmount(name: string)
	:GetMounted(name: string) -> GuiObject?

Functions

Init

GuiManager:Init() → ()

Parents the ScreenGui to the PlayerGui.

Mount

GuiManager:Mount(
guiGuiObject,--

The GuiObject to mount

namestring?--

The name of the GuiObject to mount

) → ()

Mounts the GuiObject with the given name if there is not one already mounted. If one is already mounted to the given name, it will be unmounted in favor of the new one.

Unmount

GuiManager:Unmount(
namestring,--

The name of the GuiObject to unmount

destroyboolean?--

Whether or not to actually destroy the instance

) → ()

Unmounts the GuiObject with the given name if there is one mounted.

GetMounted

GuiManager:GetMounted(
namestring?--

The name of the GuiObject to fetch

) → GuiObject?

Fetches the GuiObject with the given name if there is one mounted. If no name is provided, returns all the mounted Guis.

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Parents the ScreenGui to the PlayerGui.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 71,
                "path": "src/fusiononrails/src/FusionOnRails/FoR_GuiManager.lua"
            }
        },
        {
            "name": "Mount",
            "desc": "Mounts the GuiObject with the given name if there is not one already mounted.\nIf one is already mounted to the given name, it will be unmounted in favor of the new one.",
            "params": [
                {
                    "name": "gui",
                    "desc": "The GuiObject to mount",
                    "lua_type": "GuiObject"
                },
                {
                    "name": "name",
                    "desc": "The name of the GuiObject to mount",
                    "lua_type": "string?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 92,
                "path": "src/fusiononrails/src/FusionOnRails/FoR_GuiManager.lua"
            }
        },
        {
            "name": "Unmount",
            "desc": "Unmounts the GuiObject with the given name if there is one mounted.",
            "params": [
                {
                    "name": "name",
                    "desc": "The name of the GuiObject to unmount",
                    "lua_type": "string"
                },
                {
                    "name": "destroy",
                    "desc": "Whether or not to actually destroy the instance",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 111,
                "path": "src/fusiononrails/src/FusionOnRails/FoR_GuiManager.lua"
            }
        },
        {
            "name": "GetMounted",
            "desc": "Fetches the GuiObject with the given name if there is one mounted.\nIf no name is provided, returns all the mounted Guis.",
            "params": [
                {
                    "name": "name",
                    "desc": "The name of the GuiObject to fetch",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "GuiObject?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 131,
                "path": "src/fusiononrails/src/FusionOnRails/FoR_GuiManager.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "GuiManager",
    "desc": "GuiManager is a singleton class that manages the mounting and unmounting of\nGuiObjects to the PlayerGui. It is intended to be used as a singleton and\nshould be accessed via FusionOnRails.GuiManager. This is not meant to be a\nreplacement for dedicated UI frameworks, but rather a way to easily manage\nUIs that are not complex enough to warrant a dedicated framework.\n\n[API]\n\t[CLASS PROPS]\n\t\t.ScreenGui: ScreenGui\n\n\t[OBJECT SIGNALS]\n\t\t:GetSignal(\"Mounted\") -> Signal<GuiObject, string>\n\n\t[OBJECT METHODS]\n\t\t:Mount(gui: GuiObject, name: string?)\n\t\t:Unmount(name: string)\n\t\t:GetMounted(name: string) -> GuiObject?",
    "source": {
        "line": 25,
        "path": "src/fusiononrails/src/FusionOnRails/FoR_GuiManager.lua"
    }
}