Module: Hasu::Guard
- Defined in:
- lib/hasu/guard.rb
Instance Method Summary collapse
Instance Method Details
#_hasu_font ⇒ Object
36 37 38 |
# File 'lib/hasu/guard.rb', line 36 def _hasu_font @_hasu_font ||= Gosu::Font.new(self, Gosu::default_font_name, 16) end |
#button_down(id) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/hasu/guard.rb', line 40 def (id) if id == Gosu::KbR reset else begin super(id) rescue => e Hasu.error = e end end end |
#draw ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/hasu/guard.rb', line 21 def draw(*) if Hasu.error ([Hasu.error.inspect] + Hasu.error.backtrace).each_with_index do |line, i| _hasu_font.draw_text(line.gsub("\n",''), 10, 10 + i * 16, 0) end else begin super rescue => e Hasu.error = e draw end end end |