文章や選択肢などを表示するメッセージウィンドウの状態を扱うクラスです。この クラスのインスタンスは $game_message で参照されます。
- A
- B
- C
- H
- I
- N
[RW] | background | |
[RW] | choice_cancel_type | |
[RW] | choice_proc | |
[R] | choices | |
[RW] | face_index | |
[RW] | face_name | |
[RW] | item_choice_variable_id | |
[RW] | num_input_digits_max | |
[RW] | num_input_variable_id | |
[RW] | position | |
[RW] | scroll_mode | |
[RW] | scroll_no_fast | |
[RW] | scroll_speed | |
[R] | texts | 公開インスタンス変数 |
[RW] | visible |
オブジェクト初期化
Source: show
# File Game_Message.rb, line 30 def initialize clear @visible = false end
テキストの追加
Source: show
# File Game_Message.rb, line 58 def add(text) @texts.push(text) end
改行込みの全テキストを取得
Source: show
# File Game_Message.rb, line 107 def all_text @texts.inject("") {|r, text| r += text + "\n" } end
ビジー判定
Source: show
# File Game_Message.rb, line 93 def busy? has_text? || choice? || num_input? || item_choice? end
選択肢モード判定
Source: show
# File Game_Message.rb, line 72 def choice? @choices.size > 0 end
クリア
Source: show
# File Game_Message.rb, line 38 def clear @texts = [] @choices = [] @face_name = "" @face_index = 0 @background = 0 @position = 2 @choice_cancel_type = 0 @choice_proc = nil @num_input_variable_id = 0 @num_input_digits_max = 0 @item_choice_variable_id = 0 @scroll_mode = false @scroll_speed = 2 @scroll_no_fast = false end
テキストの存在判定
Source: show
# File Game_Message.rb, line 65 def has_text? @texts.size > 0 end
アイテム選択モード判定
Source: show
# File Game_Message.rb, line 86 def item_choice? @item_choice_variable_id > 0 end