Skip to main content

Function: addUiSafeAreaComponent()

addUiSafeAreaComponent(world, entity, options?): UiSafeAreaDefaultedOptions

Defined in: ui/components/ui-safe-area-component.ts:56

Attaches a UiSafeAreaEcsComponent to entity. entity should already be anchored with UiAnchor.stretchAll() - createUiSafeAreaEcsSystem takes over its x/y/anchoredPosition entirely, the same way a slider's handle axis is system-owned.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options?​

Partial<UiSafeAreaDefaultedOptions> = {}

Options for configuring which edges to inset.

Returns​

UiSafeAreaDefaultedOptions

The attached component, for further tuning or runtime changes.