Module: Rhythmmml::Object::Base
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #draw ⇒ Object
- #draw_rectangle(x1, y1, x2, y2, color, z) ⇒ Object
- #initialize(window, x, y, options = {}) ⇒ Object
- #update ⇒ Object
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
6 7 8 |
# File 'lib/rhythmmml/object.rb', line 6 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
6 7 8 |
# File 'lib/rhythmmml/object.rb', line 6 def y @y end |
Instance Method Details
#draw ⇒ Object
25 26 |
# File 'lib/rhythmmml/object.rb', line 25 def draw end |
#draw_rectangle(x1, y1, x2, y2, color, z) ⇒ Object
28 29 30 31 32 33 34 |
# 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 |
#initialize(window, x, y, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rhythmmml/object.rb', line 7 def initialize(window, x, y, ={}) @window = window @x = x @y = y @color = [:color] || Gosu::Color::WHITE @z_order = [:z_order] || ZOrder::OBJECT @font_name = [:font_name] || "PressStart2P" @font_path = File.join(@window.[:font_dir], "#{@font_name}.ttf") @font_size = [:font_size] || 24 @font = Gosu::Font.new(@window, @font_path, @font_size) end |
#update ⇒ Object
22 23 |
# File 'lib/rhythmmml/object.rb', line 22 def update end |