Module: SceneManager

Defined in:
SceneManager.rb

Overview

** SceneManager


This module manages scene transitions. For example, it can handle

hierarchical structures such as calling the item screen from the main menu or returning from the item screen to the main menu.

Class Method Summary (collapse)

Class Method Details

+ (Object) background_bitmap


  • Get Background Bitmap




91
92
93
# File 'SceneManager.rb', line 91

def self.background_bitmap
  @background_bitmap
end

+ (Object) call(scene_class)


  • Call




58
59
60
61
# File 'SceneManager.rb', line 58

def self.call(scene_class)
  @stack.push(@scene)
  @scene = scene_class.new
end

+ (Object) clear


  • Clear Call Stack




71
72
73
# File 'SceneManager.rb', line 71

def self.clear
  @stack.clear
end

+ (Object) exit


  • Exit Game




77
78
79
# File 'SceneManager.rb', line 77

def self.exit
  @scene = nil
end

+ (Object) first_scene_class


  • Get First Scene Class




28
29
30
# File 'SceneManager.rb', line 28

def self.first_scene_class
  $BTEST ? Scene_Battle : Scene_Title
end

+ (Object) goto(scene_class)


  • Direct Transition




52
53
54
# File 'SceneManager.rb', line 52

def self.goto(scene_class)
  @scene = scene_class.new
end

+ (Object) return


  • Return to Caller




65
66
67
# File 'SceneManager.rb', line 65

def self.return
  @scene = @stack.pop
end

+ (Object) run


  • Execute




19
20
21
22
23
24
# File 'SceneManager.rb', line 19

def self.run
  DataManager.init
  Audio.setup_midi if use_midi?
  @scene = first_scene_class.new
  @scene.main while @scene
end

+ (Object) scene


  • Get Current Scene




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

def self.scene
  @scene
end

+ (Boolean) scene_is?(scene_class)


  • Determine Current Scene Class


Returns:

  • (Boolean)


46
47
48
# File 'SceneManager.rb', line 46

def self.scene_is?(scene_class)
  @scene.instance_of?(scene_class)
end

+ (Object) snapshot_for_background


  • Create Snapshot to Use as Background




83
84
85
86
87
# File 'SceneManager.rb', line 83

def self.snapshot_for_background
  @background_bitmap.dispose if @background_bitmap
  @background_bitmap = Graphics.snap_to_bitmap
  @background_bitmap.blur
end

+ (Boolean) use_midi?


  • Use MIDI?


Returns:

  • (Boolean)


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

def self.use_midi?
  $data_system.opt_use_midi
end