Class: Badline::GUI::ScreenPane

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

Constant Summary collapse

WIDTH =
384
HEIGHT =
272
COL_OFFSET =
96
ROW_OFFSET =
20
ROW_BYTES =
WIDTH * 4

Instance Attribute Summary

Attributes inherited from Pane

#height, #left, #top, #width

Instance Method Summary collapse

Constructor Details

#initialize(computer, left: 0, top: 0, palette: Palette.new) ⇒ ScreenPane

Returns a new instance of ScreenPane.



13
14
15
16
17
18
# File 'lib/badline/gui/screen_pane.rb', line 13

def initialize(computer, left: 0, top: 0, palette: Palette.new)
  super(width: WIDTH, height: HEIGHT, left:, top:)
  @computer = computer
  @palette = palette.dwords
  @buffer = ("\x00" * (HEIGHT * ROW_BYTES)).b
end

Instance Method Details

#render(renderer) ⇒ Object



20
21
22
# File 'lib/badline/gui/screen_pane.rb', line 20

def render(renderer)
  blit(renderer, framebuffer)
end