class
Opal::UI::Layer
- Opal::UI::Layer
- Reference
- Object
Overview
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.
Defined in:
opal/ui/layer.crConstructors
Instance Method Summary
-
#blit_to(target : Buffer) : Nil
Blits this layer onto a target buffer at (@x, @y), respecting visibility, transparent_bg, and any layer clipping rectangle.
- #buffer : Buffer
-
#clear : Nil
Clears the layer's internal buffer.
- #clip_rect : Rect | Nil
- #clip_rect=(clip_rect : Rect | Nil)
- #height : Int32
- #opacity : Float64
- #opacity=(opacity : Float64)
-
#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.
-
#resize(new_width : Int32, new_height : Int32) : self
Resizes the layer's internal buffer, preserving existing content if possible.
- #transparent_bg=(transparent_bg : Bool)
- #transparent_bg? : Bool
- #visible=(visible : Bool)
- #visible? : Bool
- #width : Int32
- #x : Int32
- #x=(x : Int32)
- #y : Int32
- #y=(y : Int32)
- #z_index : Int32
- #z_index=(z_index : Int32)
Constructor Detail
Instance Method Detail
Blits this layer onto a target buffer at (@x, @y), respecting visibility, transparent_bg, and any layer clipping rectangle.
Renders a declarative UI element onto this layer.
Resizes the layer's internal buffer, preserving existing content if possible.