Class: GGLib::SplashScreen
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- GGLib::SplashScreen
- Defined in:
- lib/ext/splash.rb
Instance Method Summary collapse
-
#createWindow ⇒ Object
Override with method with the code needed to initialize the main application window.
- #draw ⇒ Object
-
#initialize(width = 640, height = 480, img = "null.png", caption = "Loading...") ⇒ SplashScreen
constructor
A new instance of SplashScreen.
-
#load ⇒ Object
Override this method and include all initialization methods here *except for opening the window*.
- #update ⇒ Object
Constructor Details
#initialize(width = 640, height = 480, img = "null.png", caption = "Loading...") ⇒ SplashScreen
Returns a new instance of SplashScreen.
4 5 6 7 8 9 |
# File 'lib/ext/splash.rb', line 4 def initialize(width=640, height=480, img = "null.png", = "Loading...") super(width, height, false, 20) self. = @background_image = Gosu::Image.new(self, img, true) @done=false end |
Instance Method Details
#createWindow ⇒ Object
Override with method with the code needed to initialize the main application window.
17 18 19 |
# File 'lib/ext/splash.rb', line 17 def createWindow end |
#draw ⇒ Object
37 38 39 |
# File 'lib/ext/splash.rb', line 37 def draw @background_image.draw(0, 0, 0) end |
#load ⇒ Object
Override this method and include all initialization methods here *except for opening the window*.
12 13 14 |
# File 'lib/ext/splash.rb', line 12 def load end |
#update ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ext/splash.rb', line 21 def update load @done=true if @done puts "\nLaunching in:\n3" sleep(1) puts "2" sleep(1) puts "1" sleep(1) puts "0" close createWindow end end |