Class: Game_Message
- Inherits:
-
Object
- Object
- Game_Message
- Defined in:
- lib/rgss3_default_scripts/Game_Message.rb
Overview
** Game_Message
This class handles the state of the message window that displays text or
selections, etc. The instance of this class is referenced by $game_message.
Instance Attribute Summary collapse
-
#background ⇒ Object
background type.
-
#choice_cancel_type ⇒ Object
show choices: cancel.
-
#choice_proc ⇒ Object
show choices: call back (Proc).
-
#choices ⇒ Object
readonly
choice array.
-
#face_index ⇒ Object
face graphic index.
-
#face_name ⇒ Object
face graphic filename.
-
#item_choice_variable_id ⇒ Object
item selection: variable ID.
-
#num_input_digits_max ⇒ Object
input number: digit count.
-
#num_input_variable_id ⇒ Object
input number: variable ID.
-
#position ⇒ Object
display position.
-
#scroll_mode ⇒ Object
scroll text flag.
-
#scroll_no_fast ⇒ Object
scroll text: disable fast forward.
-
#scroll_speed ⇒ Object
scroll text: speed.
-
#texts ⇒ Object
readonly
————————————————————————– * Public Instance Variables ————————————————————————–.
-
#visible ⇒ Object
displaying a message.
Instance Method Summary collapse
-
#add(text) ⇒ Object
————————————————————————– * Add Text ————————————————————————–.
-
#all_text ⇒ Object
————————————————————————– * Get All Text Including New Lines ————————————————————————–.
-
#busy? ⇒ Boolean
————————————————————————– * Determine if Busy ————————————————————————–.
-
#choice? ⇒ Boolean
————————————————————————– * Determine if Choices Mode ————————————————————————–.
-
#clear ⇒ Object
————————————————————————– * Clear ————————————————————————–.
-
#has_text? ⇒ Boolean
————————————————————————– * Determine Existence of Text ————————————————————————–.
-
#initialize ⇒ Game_Message
constructor
————————————————————————– * Object Initialization ————————————————————————–.
-
#item_choice? ⇒ Boolean
————————————————————————– * Determine if Item Selection Mode ————————————————————————–.
-
#new_page ⇒ Object
————————————————————————– * New Page ————————————————————————–.
-
#num_input? ⇒ Boolean
————————————————————————– * Determine if Number Input Mode ————————————————————————–.
Constructor Details
#initialize ⇒ Game_Message
-
Object Initialization
30 31 32 33 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 30 def initialize clear @visible = false end |
Instance Attribute Details
#background ⇒ Object
background type
16 17 18 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 16 def background @background end |
#choice_cancel_type ⇒ Object
show choices: cancel
19 20 21 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 19 def choice_cancel_type @choice_cancel_type end |
#choice_proc ⇒ Object
show choices: call back (Proc)
18 19 20 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 18 def choice_proc @choice_proc end |
#choices ⇒ Object (readonly)
choice array
13 14 15 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 13 def choices @choices end |
#face_index ⇒ Object
face graphic index
15 16 17 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 15 def face_index @face_index end |
#face_name ⇒ Object
face graphic filename
14 15 16 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 14 def face_name @face_name end |
#item_choice_variable_id ⇒ Object
item selection: variable ID
22 23 24 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 22 def item_choice_variable_id @item_choice_variable_id end |
#num_input_digits_max ⇒ Object
input number: digit count
21 22 23 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 21 def num_input_digits_max @num_input_digits_max end |
#num_input_variable_id ⇒ Object
input number: variable ID
20 21 22 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 20 def num_input_variable_id @num_input_variable_id end |
#position ⇒ Object
display position
17 18 19 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 17 def position @position end |
#scroll_mode ⇒ Object
scroll text flag
23 24 25 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 23 def scroll_mode @scroll_mode end |
#scroll_no_fast ⇒ Object
scroll text: disable fast forward
25 26 27 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 25 def scroll_no_fast @scroll_no_fast end |
#scroll_speed ⇒ Object
scroll text: speed
24 25 26 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 24 def scroll_speed @scroll_speed end |
#texts ⇒ Object (readonly)
-
Public Instance Variables
12 13 14 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 12 def texts @texts end |
#visible ⇒ Object
displaying a message
26 27 28 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 26 def visible @visible end |
Instance Method Details
#add(text) ⇒ Object
-
Add Text
56 57 58 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 56 def add(text) @texts.push(text) end |
#all_text ⇒ Object
-
Get All Text Including New Lines
98 99 100 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 98 def all_text @texts.inject("") {|r, text| r += text + "\n" } end |
#busy? ⇒ Boolean
-
Determine if Busy
86 87 88 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 86 def busy? has_text? || choice? || num_input? || item_choice? end |
#choice? ⇒ Boolean
-
Determine if Choices Mode
68 69 70 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 68 def choice? @choices.size > 0 end |
#clear ⇒ Object
-
Clear
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 37 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 |
#has_text? ⇒ Boolean
-
Determine Existence of Text
62 63 64 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 62 def has_text? @texts.size > 0 end |
#item_choice? ⇒ Boolean
-
Determine if Item Selection Mode
80 81 82 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 80 def item_choice? @item_choice_variable_id > 0 end |
#new_page ⇒ Object
-
New Page
92 93 94 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 92 def new_page @texts[-1] += "\f" if @texts.size > 0 end |
#num_input? ⇒ Boolean
-
Determine if Number Input Mode
74 75 76 |
# File 'lib/rgss3_default_scripts/Game_Message.rb', line 74 def num_input? @num_input_variable_id > 0 end |