class

Opal::UI::Layer

Inherits Reference < Object

Represents an isolated 2D drawing surface with position, z-index, visibility, and clipping rectangle. Layers allow complex UIs, floating windows, dropdowns, and overlays to be rendered independently and composited in depth order.

Constructors

new(width : Int32, height : Int32, x : Int32 = 0, y : Int32 = 0, z_index : Int32 = 0, visible : Bool = true, transparent_bg : Bool = true, clip_rect : Rect | Nil = nil)
Source

Instance methods

blit_to(target : Buffer) : Nil

Blits this layer onto a target buffer at (@x, @y), respecting visibility, transparent_bg, and any layer clipping rectangle.

Source
buffer
Source
clear

Clears the layer's internal buffer.

Source
clip_rect
Source
clip_rect=(clip_rect : Rect | Nil)
Source
height
Source
opacity
Source
opacity=(opacity : Float64)
Source
render_element(element : Element, rel_x : Int32 = 0, rel_y : Int32 = 0, render_w : Int32 | Nil = nil, render_h : Int32 | Nil = nil) : Nil

Renders a declarative UI element onto this layer.

Source
resize(new_width : Int32, new_height : Int32) : self

Resizes the layer's internal buffer, preserving existing content if possible.

Source
transparent_bg=(transparent_bg : Bool)
Source
transparent_bg?
Source
visible=(visible : Bool)
Source
visible?
Source
width
Source
x=(x : Int32)
Source
y=(y : Int32)
Source
z_index
Source
z_index=(z_index : Int32)
Source