Class: Scene_Base

Inherits:
Object
  • Object
show all
Defined in:
Scene_Base.rb

Overview

** Scene_Base


This is a super class of all scenes within the game.

Direct Known Subclasses

Scene_Battle, Scene_Gameover, Scene_Map, Scene_MenuBase, Scene_Title

Instance Method Summary (collapse)

Instance Method Details

- (Object) check_gameover


  • Determine if Game Is Over Transition to the game over screen if the entire party is dead.




129
130
131
# File 'Scene_Base.rb', line 129

def check_gameover
  SceneManager.goto(Scene_Gameover) if $game_party.all_dead?
end

- (Object) create_main_viewport


  • Create Viewport




79
80
81
82
# File 'Scene_Base.rb', line 79

def create_main_viewport
  @viewport = Viewport.new
  @viewport.z = 200
end

- (Object) dispose_all_windows


  • Free All Windows




101
102
103
104
105
106
# File 'Scene_Base.rb', line 101

def dispose_all_windows
  instance_variables.each do |varname|
    ivar = instance_variable_get(varname)
    ivar.dispose if ivar.is_a?(Window)
  end
end

- (Object) dispose_main_viewport


  • Free Viewport




86
87
88
# File 'Scene_Base.rb', line 86

def dispose_main_viewport
  @viewport.dispose
end

- (Object) fadeout_all(time = 1000)


  • Fade Out All Sounds and Graphics




116
117
118
119
120
121
122
123
124
# File 'Scene_Base.rb', line 116

def fadeout_all(time = 1000)
  RPG::BGM.fade(time)
  RPG::BGS.fade(time)
  RPG::ME.fade(time)
  Graphics.fadeout(time * Graphics.frame_rate / 1000)
  RPG::BGM.stop
  RPG::BGS.stop
  RPG::ME.stop
end

- (Object) main


  • Main




11
12
13
14
15
16
17
# File 'Scene_Base.rb', line 11

def main
  start
  post_start
  update until scene_changing?
  pre_terminate
  terminate
end

- (Object) perform_transition


  • Execute Transition




67
68
69
# File 'Scene_Base.rb', line 67

def perform_transition
  Graphics.transition(transition_speed)
end

- (Object) post_start


  • Post-Start Processing




27
28
29
30
# File 'Scene_Base.rb', line 27

def post_start
  perform_transition
  Input.update
end

- (Object) pre_terminate


  • Pre-Termination Processing




54
55
# File 'Scene_Base.rb', line 54

def pre_terminate
end

- (Object) return_scene


  • Return to Calling Scene




110
111
112
# File 'Scene_Base.rb', line 110

def return_scene
  SceneManager.return
end

- (Boolean) scene_changing?


  • Determine if Scene Is Changing


Returns:

  • (Boolean)


34
35
36
# File 'Scene_Base.rb', line 34

def scene_changing?
  SceneManager.scene != self
end

- (Object) start


  • Start Processing




21
22
23
# File 'Scene_Base.rb', line 21

def start
  create_main_viewport
end

- (Object) terminate


  • Termination Processing




59
60
61
62
63
# File 'Scene_Base.rb', line 59

def terminate
  Graphics.freeze
  dispose_all_windows
  dispose_main_viewport
end

- (Object) transition_speed


  • Get Transition Speed




73
74
75
# File 'Scene_Base.rb', line 73

def transition_speed
  return 10
end

- (Object) update


  • Frame Update




40
41
42
# File 'Scene_Base.rb', line 40

def update
  update_basic
end

- (Object) update_all_windows


  • Update All Windows




92
93
94
95
96
97
# File 'Scene_Base.rb', line 92

def update_all_windows
  instance_variables.each do |varname|
    ivar = instance_variable_get(varname)
    ivar.update if ivar.is_a?(Window)
  end
end

- (Object) update_basic


  • Update Frame (Basic)




46
47
48
49
50
# File 'Scene_Base.rb', line 46

def update_basic
  Graphics.update
  Input.update
  update_all_windows
end