Class: Rhythmmml::Object::Info

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/rhythmmml/object.rb

Instance Attribute Summary collapse

Attributes included from Base

#x, #y

Instance Method Summary collapse

Methods included from Base

#draw_rectangle, #update

Constructor Details

#initialize(window, x, y, options = {}) ⇒ Info

Returns a new instance of Info.



65
66
67
68
# File 'lib/rhythmmml/object.rb', line 65

def initialize(window, x, y, options={})
  super
  @score = 0
end

Instance Attribute Details

#scoreObject

Returns the value of attribute score.



64
65
66
# File 'lib/rhythmmml/object.rb', line 64

def score
  @score
end

Instance Method Details

#drawObject



70
71
72
73
# File 'lib/rhythmmml/object.rb', line 70

def draw
  @font.draw("SCORE:", @x, @y, @z_order)
  @font.draw("%08d" % @score, @x, @y + @font_size, @z_order)
end