Class: GGLib::SplashScreen

Inherits:
Gosu::Window
  • Object
show all
Defined in:
lib/ext/splash.rb

Instance Method Summary collapse

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", caption = "Loading...")
  super(width, height, false, 20)
  self.caption = caption
  @background_image = Gosu::Image.new(self, img, true)
  @done=false
end

Instance Method Details

#createWindowObject

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

#drawObject



37
38
39
# File 'lib/ext/splash.rb', line 37

def draw
  @background_image.draw(0, 0, 0)
end

#loadObject

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

#updateObject



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