Class: Game_Message

Inherits:
Object
  • Object
show all
Defined in:
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)

Instance Method Summary (collapse)

Constructor Details

- (Game_Message) initialize


  • Object Initialization




30
31
32
33
# File 'Game_Message.rb', line 30

def initialize
  clear
  @visible = false
end

Instance Attribute Details

- (Object) background

background type



16
17
18
# File 'Game_Message.rb', line 16

def background
  @background
end

- (Object) choice_cancel_type

show choices: cancel



19
20
21
# File 'Game_Message.rb', line 19

def choice_cancel_type
  @choice_cancel_type
end

- (Object) choice_proc

show choices: call back (Proc)



18
19
20
# File 'Game_Message.rb', line 18

def choice_proc
  @choice_proc
end

- (Object) choices (readonly)

choice array



13
14
15
# File 'Game_Message.rb', line 13

def choices
  @choices
end

- (Object) face_index

face graphic index



15
16
17
# File 'Game_Message.rb', line 15

def face_index
  @face_index
end

- (Object) face_name

face graphic filename



14
15
16
# File 'Game_Message.rb', line 14

def face_name
  @face_name
end

- (Object) item_choice_variable_id

item selection: variable ID



22
23
24
# File 'Game_Message.rb', line 22

def item_choice_variable_id
  @item_choice_variable_id
end

- (Object) num_input_digits_max

input number: digit count



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

def num_input_digits_max
  @num_input_digits_max
end

- (Object) num_input_variable_id

input number: variable ID



20
21
22
# File 'Game_Message.rb', line 20

def num_input_variable_id
  @num_input_variable_id
end

- (Object) position

display position



17
18
19
# File 'Game_Message.rb', line 17

def position
  @position
end

- (Object) scroll_mode

scroll text flag



23
24
25
# File 'Game_Message.rb', line 23

def scroll_mode
  @scroll_mode
end

- (Object) scroll_no_fast

scroll text: disable fast forward



25
26
27
# File 'Game_Message.rb', line 25

def scroll_no_fast
  @scroll_no_fast
end

- (Object) scroll_speed

scroll text: speed



24
25
26
# File 'Game_Message.rb', line 24

def scroll_speed
  @scroll_speed
end

- (Object) texts (readonly)


  • Public Instance Variables




12
13
14
# File 'Game_Message.rb', line 12

def texts
  @texts
end

- (Object) visible

displaying a message



26
27
28
# File 'Game_Message.rb', line 26

def visible
  @visible
end

Instance Method Details

- (Object) add(text)


  • Add Text




56
57
58
# File 'Game_Message.rb', line 56

def add(text)
  @texts.push(text)
end

- (Object) all_text


  • Get All Text Including New Lines




98
99
100
# File 'Game_Message.rb', line 98

def all_text
  @texts.inject("") {|r, text| r += text + "\n" }
end

- (Boolean) busy?


  • Determine if Busy


Returns:

  • (Boolean)


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

def busy?
  has_text? || choice? || num_input? || item_choice?
end

- (Boolean) choice?


  • Determine if Choices Mode


Returns:

  • (Boolean)


68
69
70
# File 'Game_Message.rb', line 68

def choice?
  @choices.size > 0
end

- (Object) clear


  • Clear




37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File '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

- (Boolean) has_text?


  • Determine Existence of Text


Returns:

  • (Boolean)


62
63
64
# File 'Game_Message.rb', line 62

def has_text?
  @texts.size > 0
end

- (Boolean) item_choice?


  • Determine if Item Selection Mode


Returns:

  • (Boolean)


80
81
82
# File 'Game_Message.rb', line 80

def item_choice?
  @item_choice_variable_id > 0
end

- (Object) new_page


  • New Page




92
93
94
# File 'Game_Message.rb', line 92

def new_page
  @texts[-1] += "\f" if @texts.size > 0
end

- (Boolean) num_input?


  • Determine if Number Input Mode


Returns:

  • (Boolean)


74
75
76
# File 'Game_Message.rb', line 74

def num_input?
  @num_input_variable_id > 0
end