Skip to content

AxisTriadLayer.setAnchor

Summary

AxisTriadLayer.setAnchor sets the screen-corner or world-space anchor. Changing the anchor invalidates overlay layout.

Syntax

AxisTriadLayer.setAnchor(anchor: OverlayAnchorDescriptor): this
layer.setAnchor(anchor);

Parameters

Name Type Required Description
anchor OverlayAnchorDescriptor Yes Screen or world anchor descriptor.

Returns

this - The same instance for method chaining.

Type Details

type OverlayAnchorDescriptor = ScreenAnchorDescriptor | WorldAnchorDescriptor;

Example

const layer = wgpu.createOverlay.axisTriad();
layer.setAnchor({ kind: "screen", corner: "top-left", offsetPx: [20, 20] });

See Also