class Onsengame::Scene::Title

Public Class Methods

new(window) click to toggle source
Calls superclass method Onsengame::Scene::Base::new
# File lib/onsengame/scene/title.rb, line 11
def initialize(window)
  super
  @title = Gosu::Image.from_text(@window,
                                 @window.caption,
                                 @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

Public Instance Methods

button_down(id) click to toggle source
# File lib/onsengame/scene/title.rb, line 46
def button_down(id)
  case id
  when Gosu::KbReturn
    @window.scenes.unshift(Main.new(@window))
  end
end
draw() click to toggle source
Calls superclass method Onsengame::Scene::Base#draw
# File lib/onsengame/scene/title.rb, line 39
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() click to toggle source
Calls superclass method Onsengame::Scene::Base#update
# File lib/onsengame/scene/title.rb, line 30
def update
  super
  if Time.now.sec % 2 == 0
    @guide_color = Gosu::Color::WHITE
  else
    @guide_color = Gosu::Color::GRAY
  end
end