Sha256: d1336ec06e1087ffae5d5fcca70bd6a7406a04ae98a70b37c79b93cc6d2136ee

Contents?: true

Size: 1005 Bytes

Versions: 1

Compression:

Stored size: 1005 Bytes

Contents

begin
  # In case you use Gosu via RubyGems.
  require 'rubygems'
rescue LoadError
  # In case you don't.
end

#Load Gosu
require "gosu"
#Load GGLib
require "../gglib"
#Load extra widgets (for ThemeButton)
require "../ext/widgets"

class FadeExample < GGLib::GUIWindow
  def initialize
    super(640, 480, false, 20)
    self.caption = "GGLib Tutorial"
    self.state = StartMenu.new
  end
end

#The menu we will fade from
class StartMenu < GGLib::StateObject
  def onStart
    $window.setBackground("img/splash.png")
    GGLib::ThemeButton.new("button1", "Fade", 270, 200, Proc.new{ |widget| $window.state = GGLib::FadeScreen.new(EndMenu.new, 2) })
  end
end

#The menu we will fade to
class  EndMenu < GGLib::StateObject
  def onStart
    $window.setBackground("img/bg.png")
    GGLib::ThemeButton.new("button1", "Fade Back", 270, 200, Proc.new{ |widget| $window.state = GGLib::FadeScreen.new(StartMenu.new, 2) })
  end
end

#Launch the window
FadeExample.new.show

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gglib-1.1.0 lib/examples/FadeIn.rb