Class: Badline::GUI::Pane

Inherits:
Object
  • Object
show all
Defined in:
lib/badline/gui/pane.rb

Direct Known Subclasses

ScreenPane

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject (readonly)

Returns the value of attribute height.



6
7
8
# File 'lib/badline/gui/pane.rb', line 6

def height
  @height
end

#leftObject (readonly)

Returns the value of attribute left.



6
7
8
# File 'lib/badline/gui/pane.rb', line 6

def left
  @left
end

#topObject (readonly)

Returns the value of attribute top.



6
7
8
# File 'lib/badline/gui/pane.rb', line 6

def top
  @top
end

#widthObject (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

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/badline/gui/pane.rb', line 16

def render(_renderer)
  raise NotImplementedError, "#{self.class} must implement #render"
end