Class: Rhythmmml::Scene::Title
- Inherits:
-
Object
- Object
- Rhythmmml::Scene::Title
- Includes:
- Base
- Defined in:
- lib/rhythmmml/scene.rb
Instance Method Summary collapse
- #button_down(id) ⇒ Object
- #draw ⇒ Object
-
#initialize(window) ⇒ Title
constructor
A new instance of Title.
- #update ⇒ Object
Constructor Details
#initialize(window) ⇒ Title
Returns a new instance of Title.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rhythmmml/scene.rb', line 37 def initialize(window) super @title = Gosu::Image.from_text(@window, "Rhythmmml", @font_path, 64, 4, @window.width, :center) @guide = Gosu::Image.from_text(@window, "press enter", @font_path, 36, 4, @window.width, :center) @guide_color = Gosu::Color::WHITE end |
Instance Method Details
#button_down(id) ⇒ Object
72 73 74 75 76 77 |
# File 'lib/rhythmmml/scene.rb', line 72 def (id) case id when Gosu::KbReturn @window.scenes.unshift(Main.new(@window)) end end |
#draw ⇒ Object
65 66 67 68 69 70 |
# File 'lib/rhythmmml/scene.rb', line 65 def draw super @title.draw(0, @window.height * 0.2, ZOrder::TEXT) @guide.draw(0, @window.height * 0.6, ZOrder::TEXT, 1, 1, @guide_color) end |
#update ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/rhythmmml/scene.rb', line 56 def update super if Time.now.sec % 2 == 0 @guide_color = Gosu::Color::WHITE else @guide_color = Gosu::Color::GRAY end end |