Class: BadSdl::Engine::BlockEngine

Inherits:
BadSdl::Engine show all
Defined in:
lib/bad_sdl/engine/block_engine.rb

Instance Attribute Summary collapse

Attributes inherited from BadSdl::Engine

#surface

Instance Method Summary collapse

Methods inherited from BadSdl::Engine

#handle_event, #on, #on_handlers, #quit

Constructor Details

#initialize(opts = {}) ⇒ BlockEngine

Returns a new instance of BlockEngine.



9
10
11
12
# File 'lib/bad_sdl/engine/block_engine.rb', line 9

def initialize(opts={})
  super(opts)
  painter = opts[:painter]
end

Instance Attribute Details

#painterObject

Returns the value of attribute painter.



14
15
16
# File 'lib/bad_sdl/engine/block_engine.rb', line 14

def painter
  @painter
end

Instance Method Details

#paint_to(surface) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/bad_sdl/engine/block_engine.rb', line 16

def paint_to(surface)
  unless painter.nil?
    return painter.call(surface)
  else
    return super(surface)
  end
end