Class: BadSdl::Engine::BlockEngine
- Inherits:
-
BadSdl::Engine
- Object
- BadSdl::Engine
- BadSdl::Engine::BlockEngine
- Defined in:
- lib/bad_sdl/engine/block_engine.rb
Instance Attribute Summary collapse
-
#painter ⇒ Object
Returns the value of attribute painter.
Attributes inherited from BadSdl::Engine
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ BlockEngine
constructor
A new instance of BlockEngine.
- #paint_to(surface) ⇒ Object
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
#painter ⇒ Object
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 |