Class: Badline::GUI::Pane
- Inherits:
-
Object
- Object
- Badline::GUI::Pane
- Defined in:
- lib/badline/gui/pane.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width:, height:, left: 0, top: 0) ⇒ Pane
constructor
A new instance of Pane.
- #render(_renderer) ⇒ Object
Constructor Details
#initialize(width:, height:, left: 0, top: 0) ⇒ Pane
Returns a new instance of Pane.
8 9 10 11 12 13 14 |
# File 'lib/badline/gui/pane.rb', line 8 def initialize(width:, height:, left: 0, top: 0) @width = width @height = height @left = left @top = top @rect = SDL2::Rect.new(left, top, width, height) end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
6 7 8 |
# File 'lib/badline/gui/pane.rb', line 6 def height @height end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
6 7 8 |
# File 'lib/badline/gui/pane.rb', line 6 def left @left end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
6 7 8 |
# File 'lib/badline/gui/pane.rb', line 6 def top @top end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
6 7 8 |
# File 'lib/badline/gui/pane.rb', line 6 def width @width end |
Instance Method Details
#render(_renderer) ⇒ Object
16 17 18 |
# File 'lib/badline/gui/pane.rb', line 16 def render(_renderer) raise NotImplementedError, "#{self.class} must implement #render" end |