class

Opal::UI::LayerStack

Inherits Reference < Object

Manages a depth-ordered stack of Layer surfaces. Composites layers in sorted z-index order onto a target buffer, ensuring overlays, floating windows, dropdowns, and notifications render with correct depth, transparency, and clipping.

Constants

TIER_BACKGROUND = 0

Standard semantic z-index tier constants

TIER_CONTENT = 100
TIER_CURSOR = 1000
TIER_MODALS = 800
TIER_OVERLAYS = 500
TIER_TOASTS = 900
TIER_WINDOWS = 200

Constructors

Instance methods

add(layer : Layer) : Layer

Adds an existing layer to the stack.

Source
bring_to_front(layer : Layer) : self

Elevates a layer above all other layers currently in its tier.

Source
clear

Clears all registered layers from the stack.

Source
compose(target : Buffer) : Nil

Composites all visible layers onto the target buffer in ascending z-index order.

Source
create_layer(width : Int32, height : Int32, z_index : Int32 = TIER_CONTENT, x : Int32 = 0, y : Int32 = 0, transparent_bg : Bool = true) : Layer

Factory method to create, configure, and register a new layer.

Source
layers
Source
remove(layer : Layer) : Bool

Removes a layer from the stack.

Source
send_to_back(layer : Layer) : self

Lowers a layer below all other layers in the stack.

Source