Class: Scene_Title

Inherits:
Scene_Base show all
Defined in:
lib/rgss3_default_scripts/Scene_Title.rb

Overview

** Scene_Title


This class performs the title screen processing.

Instance Method Summary collapse

Methods inherited from Scene_Base

#check_gameover, #create_main_viewport, #dispose_all_windows, #dispose_main_viewport, #fadeout_all, #main, #perform_transition, #post_start, #pre_terminate, #return_scene, #scene_changing?, #update, #update_all_windows, #update_basic

Instance Method Details

#center_sprite(sprite) ⇒ Object


  • Move Sprite to Screen Center




82
83
84
85
86
87
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 82

def center_sprite(sprite)
  sprite.ox = sprite.bitmap.width / 2
  sprite.oy = sprite.bitmap.height / 2
  sprite.x = Graphics.width / 2
  sprite.y = Graphics.height / 2
end

#close_command_windowObject


  • Close Command Window




100
101
102
103
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 100

def close_command_window
  @command_window.close
  update until @command_window.close?
end

#command_continueObject


  • Continue

    Command




117
118
119
120
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 117

def command_continue
  close_command_window
  SceneManager.call(Scene_Load)
end

#command_new_gameObject


  • New Game

    Command




107
108
109
110
111
112
113
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 107

def command_new_game
  DataManager.setup_new_game
  close_command_window
  fadeout_all
  $game_map.autoplay
  SceneManager.goto(Scene_Map)
end

#command_shutdownObject


  • Shut Down

    Command




124
125
126
127
128
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 124

def command_shutdown
  close_command_window
  fadeout_all
  SceneManager.exit
end

#create_backgroundObject


  • Create Background




38
39
40
41
42
43
44
45
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 38

def create_background
  @sprite1 = Sprite.new
  @sprite1.bitmap = Cache.title1($data_system.title1_name)
  @sprite2 = Sprite.new
  @sprite2.bitmap = Cache.title2($data_system.title2_name)
  center_sprite(@sprite1)
  center_sprite(@sprite2)
end

#create_command_windowObject


  • Create Command Window




91
92
93
94
95
96
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 91

def create_command_window
  @command_window = Window_TitleCommand.new
  @command_window.set_handler(:new_game, method(:command_new_game))
  @command_window.set_handler(:continue, method(:command_continue))
  @command_window.set_handler(:shutdown, method(:command_shutdown))
end

#create_foregroundObject


  • Create Foreground




49
50
51
52
53
54
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 49

def create_foreground
  @foreground_sprite = Sprite.new
  @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
  @foreground_sprite.z = 100
  draw_game_title if $data_system.opt_draw_title
end

#dispose_backgroundObject


  • Free Background




66
67
68
69
70
71
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 66

def dispose_background
  @sprite1.bitmap.dispose
  @sprite1.dispose
  @sprite2.bitmap.dispose
  @sprite2.dispose
end

#dispose_foregroundObject


  • Free Foreground




75
76
77
78
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 75

def dispose_foreground
  @foreground_sprite.bitmap.dispose
  @foreground_sprite.dispose
end

#draw_game_titleObject


  • Draw Game Title




58
59
60
61
62
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 58

def draw_game_title
  @foreground_sprite.bitmap.font.size = 48
  rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
  @foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)
end

#play_title_musicObject


  • Play Title Screen Music




132
133
134
135
136
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 132

def play_title_music
  $data_system.title_bgm.play
  RPG::BGS.stop
  RPG::ME.stop
end

#startObject


  • Start Processing




11
12
13
14
15
16
17
18
19
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 11

def start
  super
  SceneManager.clear
  Graphics.freeze
  create_background
  create_foreground
  create_command_window
  play_title_music
end

#terminateObject


  • Termination Processing




29
30
31
32
33
34
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 29

def terminate
  super
  SceneManager.snapshot_for_background
  dispose_background
  dispose_foreground
end

#transition_speedObject


  • Get Transition Speed




23
24
25
# File 'lib/rgss3_default_scripts/Scene_Title.rb', line 23

def transition_speed
  return 20
end