class Rhythmmml::Object::Rhythm

Attributes

info[R]

Public Class Methods

new(window, x, y, info, options={}) click to toggle source
Calls superclass method Rhythmmml::Object::Base::new
# File lib/rhythmmml/object.rb, line 41
def initialize(window, x, y, info, options={})
  super(window, x, y, options)
  @info = info
  @width2 = @window.width * 0.1 / 2
  @height2 = @window.height * 0.02 / 2
end

Public Instance Methods

draw() click to toggle source
# File lib/rhythmmml/object.rb, line 52
def draw
  x1 = @x - @width2
  y1 = @y - @height2
  x2 = @x + @width2
  y2 = @y + @height2
  draw_rectangle(x1, y1, x2, y2, @color, @z_order)
end
update() click to toggle source
# File lib/rhythmmml/object.rb, line 48
def update
  @y += 1
end