Class: Tuile::Component::Overlay::At

Inherits:
Data
  • Object
show all
Includes:
Placement
Defined in:
lib/tuile/component/overlay.rb,
sig/tuile.rbs

Overview

Places the overlay at exactly rect, in screen coordinates.

overlay.open(Overlay::At[Rect.new(10, 4, 20, 1)])

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rect ⇒ Rect (readonly)

Returns:



120
121
122
123
124
125
126
127
128
# File 'lib/tuile/component/overlay.rb', line 120

At = Data.define(:rect) do
  include Placement

  # @param _overlay [Overlay]
  # @param _screen_size [Size]
  # @param _anchor_rect [Rect, nil] unused: this placement declares no {#anchor}.
  # @return [Rect]
  def rect_for(_overlay, _screen_size, _anchor_rect) = rect
end

Instance Method Details

#anchor ⇒ Component, ...

What this placement hangs off, re-read on every pass — see the Anchors section above.

@return — nil, the default, is not anchored.

Returns:



7249
# File 'sig/tuile.rbs', line 7249

def anchor: () -> (Component | Rect)?

#rect_for(_overlay, _screen_size, _anchor_rect) ⇒ Rect

@param _overlay

@param _screen_size

@param _anchor_rect — unused: this placement declares no #anchor.

Parameters:

Returns:



127
# File 'lib/tuile/component/overlay.rb', line 127

def rect_for(_overlay, _screen_size, _anchor_rect) = rect