Skip to main content

GameScalingUtils

Scale ratios for the UI on different devices

Functions

getUIScale

GameScalingUtils.getUIScale(screenAbsoluteSizeVector2) → number

Given an screenAbsoluteSize, get a good UI scale to use for fixed offset assuming general UI scales built for 720p monitors.

observeUIScale

GameScalingUtils.observeUIScale(screenGuiScreenGui) → Observable<number>

Observes a smoothed out UI scale for a given screenGui

observeUIScaleForChild

GameScalingUtils.observeUIScaleForChild(childInstance) → Observable<number>

Observes a smoothed out UI scale for a given screenGui

renderUIScale

GameScalingUtils.renderUIScale(props{
ParentInstance?,
ScreenGuiScreenGui
}) → Observable<number>

Blend equivalent of rendering a UI Scale

renderDialogPadding

GameScalingUtils.renderDialogPadding(props{
ParentInstance?,
ScreenGuiScreenGui
}) → Observable<number>

Blend equivalent of rendering the dialog padding

observeDialogPadding

GameScalingUtils.observeDialogPadding(screenGuiScreenGui) → Observable<number>

Observes a smoothed out UI scale for a given screenGui

getDialogPadding

GameScalingUtils.getDialogPadding(screenAbsoluteSizeVector2) → number

Computes a reasonable dialog padding for a given absolute screen size

Show raw api
{
    "functions": [
        {
            "name": "getUIScale",
            "desc": "Given an screenAbsoluteSize, get a good UI scale to use for fixed offset\nassuming general UI scales built for 720p monitors.",
            "params": [
                {
                    "name": "screenAbsoluteSize",
                    "desc": "",
                    "lua_type": "Vector2"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        },
        {
            "name": "observeUIScale",
            "desc": "Observes a smoothed out UI scale for a given screenGui",
            "params": [
                {
                    "name": "screenGui",
                    "desc": "",
                    "lua_type": "ScreenGui"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 48,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        },
        {
            "name": "observeUIScaleForChild",
            "desc": "Observes a smoothed out UI scale for a given screenGui",
            "params": [
                {
                    "name": "child",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 60,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        },
        {
            "name": "renderUIScale",
            "desc": "Blend equivalent of rendering a UI Scale",
            "params": [
                {
                    "name": "props",
                    "desc": "",
                    "lua_type": "{ Parent: Instance?, ScreenGui: ScreenGui }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 78,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        },
        {
            "name": "renderDialogPadding",
            "desc": "Blend equivalent of rendering the dialog padding",
            "params": [
                {
                    "name": "props",
                    "desc": "",
                    "lua_type": "{ Parent: Instance?, ScreenGui: ScreenGui }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 93,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        },
        {
            "name": "observeDialogPadding",
            "desc": "Observes a smoothed out UI scale for a given screenGui",
            "params": [
                {
                    "name": "screenGui",
                    "desc": "",
                    "lua_type": "ScreenGui"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 110,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        },
        {
            "name": "getDialogPadding",
            "desc": "Computes a reasonable dialog padding for a given absolute screen size",
            "params": [
                {
                    "name": "screenAbsoluteSize",
                    "desc": "",
                    "lua_type": "Vector2"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 126,
                "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "GameScalingUtils",
    "desc": "Scale ratios for the UI on different devices",
    "source": {
        "line": 5,
        "path": "src/gamescalingutils/src/Client/GameScalingUtils.lua"
    }
}