NUI / Components / Layout

SafeZone

ImplementedLayout

SafeZone keeps one child inside configured screen-safe areas.

Supported as a one-child safe-area wrapper.

Overview

SafeZone keeps one child inside configured screen-safe areas.

When to use

  • HUD roots and screen-edge UI that should avoid unsafe display regions.

Children

Supports exactly one child.

nui
children {
    Text ChildText {
        text: "THIS IS THE CHILD COMPONENT"
    }
}

Basic syntax

nui
SafeZone HudSafeZone {
    titleSafe: true

    children {
        Text ChildText {
            text: "THIS IS THE CHILD COMPONENT"
        }
    }
}

Supported properties

PropertyTypeRequiredDefaultDescription
titleSafeboolNofalseUses title-safe area rules.
safeLeftboolNotrueApplies left safe area.
safeTopboolNotrueApplies top safe area.
safeRightboolNotrueApplies right safe area.
safeBottomboolNotrueApplies bottom safe area.
padLeftboolNofalseEnables left safe-zone padding.
padTopboolNofalseEnables top safe-zone padding.
padRightboolNofalseEnables right safe-zone padding.
padBottomboolNofalseEnables bottom safe-zone padding.
safeAreaScalenumberNo1Safe area scale multiplier.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
paddingmarginNomargin(0)Inner padding.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

SafeZone may receive stack, canvas, grid, wrap, or ExpandableArea slot properties only when it is authored as a direct child of the matching parent. See section 7.

Full syntax example

nui
SafeZone HudSafeZone {
    titleSafe: true
    safeLeft: true
    safeTop: true
    safeRight: true
    safeBottom: true
    padLeft: true
    padTop: true
    padRight: true
    padBottom: true
    safeAreaScale: 1
    width: 1280
    height: 720
    padding: margin(0)
    visible: true

    children {
        Text ChildText {
            text: "THIS IS THE CHILD COMPONENT"
        }
    }
}

Limitations

  • SafeZone must contain exactly one child.