Class: Scene_Debug

Inherits:
Scene_MenuBase show all
Defined in:
Scene_Debug.rb

Overview

** Scene_Debug


This class performs debug screen processing.

Instance Method Summary (collapse)

Methods inherited from Scene_MenuBase

#create_background, #create_help_window, #dispose_background, #next_actor, #on_actor_change, #prev_actor

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?, #transition_speed, #update, #update_all_windows, #update_basic

Instance Method Details

- (Object) create_debug_help_window


  • Create Help Window




45
46
47
48
49
50
51
# File 'Scene_Debug.rb', line 45

def create_debug_help_window
  wx = @right_window.x
  wy = @right_window.height
  ww = @right_window.width
  wh = Graphics.height - wy
  @debug_help_window = Window_Base.new(wx, wy, ww, wh)
end

- (Object) create_left_window


  • Create Left Window




27
28
29
30
31
# File 'Scene_Debug.rb', line 27

def create_left_window
  @left_window = Window_DebugLeft.new(0, 0)
  @left_window.set_handler(:ok,     method(:on_left_ok))
  @left_window.set_handler(:cancel, method(:return_scene))
end

- (Object) create_right_window


  • Create Right Window




35
36
37
38
39
40
41
# File 'Scene_Debug.rb', line 35

def create_right_window
  wx = @left_window.width
  ww = Graphics.width - wx
  @right_window = Window_DebugRight.new(wx, 0, ww)
  @right_window.set_handler(:cancel, method(:on_right_cancel))
  @left_window.right_window = @right_window
end

- (Object) help_text


  • Get Help Text




77
78
79
80
81
82
83
84
85
86
# File 'Scene_Debug.rb', line 77

def help_text
  if @left_window.mode == :switch
    "C (Enter) : ON / OFF"
  else
    "← (Left)    :  -1\n" +
    "→ (Right)   :  +1\n" +
    "L (Pageup)   : -10\n" +
    "R (Pagedown) : +10"
  end
end

- (Object) on_left_ok


  • Left [OK]




55
56
57
58
59
# File 'Scene_Debug.rb', line 55

def on_left_ok
  refresh_help_window
  @right_window.activate
  @right_window.select(0)
end

- (Object) on_right_cancel


  • Right [Cancel]




63
64
65
66
67
# File 'Scene_Debug.rb', line 63

def on_right_cancel
  @left_window.activate
  @right_window.unselect
  @debug_help_window.contents.clear
end

- (Object) refresh_help_window


  • Refresh Help Window




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

def refresh_help_window
  @debug_help_window.draw_text_ex(4, 0, help_text)
end

- (Object) start


  • Start Processing




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

def start
  super
  create_left_window
  create_right_window
  create_debug_help_window
end

- (Object) terminate


  • Termination Processing




20
21
22
23
# File 'Scene_Debug.rb', line 20

def terminate
  super
  #$game_map.refresh
end