module Rhythmmml::Object::Base

Attributes

x[R]
y[R]

Public Class Methods

new(window, x, y, options={}) click to toggle source
# File lib/rhythmmml/object.rb, line 7
def initialize(window, x, y, options={})
  @window = window
  @x = x
  @y = y
  @color = options[:color] || Gosu::Color::WHITE
  @z_order = options[:z_order] || ZOrder::OBJECT
  @font_name = options[:font_name] || "PressStart2P"
  @font_path = File.join(@window.options[:font_dir],
                         "#{@font_name}.ttf")
  @font_size = options[:font_size] || 24
  @font = Gosu::Font.new(@window,
                         @font_path,
                         @font_size)
end

Public Instance Methods

draw() click to toggle source
# File lib/rhythmmml/object.rb, line 25
def draw
end
draw_rectangle(x1, y1, x2, y2, color, z) click to toggle source
# File lib/rhythmmml/object.rb, line 28
def draw_rectangle(x1, y1, x2, y2, color, z)
  @window.draw_quad(x1, y1, color,
                    x2, y1, color,
                    x2, y2, color,
                    x1, y2, color,
                    z)
end
update() click to toggle source
# File lib/rhythmmml/object.rb, line 22
def update
end