제가 만들고있는 게임에 메세지 업그레이드 라는 스크립트를 넣었습니다.
그런데 뜬금없이 스크립트를 넣고 오프닝을 돌리니.. 아무 글씨도 보이지 않습니다.
*메세지 업그레이드 스크립트
=begin메세지 EX
#===============================================================================
# by Xiderowg (XMS) 부분번역 : philosopher
# Versão - built 200723(XRXS21)
#===============================================================================
Info
메세지가 화면의 가장자리에 나타납니다,
--------------------------------------------------------------------------------
화면에 메세지를 고정시킵니다.
hold
--------------------------------------------------------------------------------
fade
화면에 나타난 글자들이 서서히 사라집니다.
--------------------------------------------------------------------------------
name[이름]
문장과 함께 이름을 표시합니다.
--------------------------------------------------------------------------------
p[n]
특정 오브젝트 밑에 문장을 표시합니다.
--------------------------------------------------------------------------------
center
문장이 중간에서 부터 나타납니다.
--------------------------------------------------------------------------------
right
문장이 오른쪽에서 부터 나타납니다.
--------------------------------------------------------------------------------
B
문장을 굵게 표시합니다.
--------------------------------------------------------------------------------
글꼴 크기
h[n]
문장의 크기를 조절합니다.
6 ~ 32 까지 변경할수 있습니다.
--------------------------------------------------------------------------------
o[n]
문장의 투명도를 조절합니다.
0 ~ 255 까지 변경할수 있습니다.
--------------------------------------------------------------------------------
b[n]
문장의 위치를 조절할수 있습니다.
--------------------------------------------------------------------------------
n
n 앞에 쓰여진 글을 밑으로 내립니다.
--------------------------------------------------------------------------------
next
다음문장에 있는글을 같이 나타냅니다.
--------------------------------------------------------------------------------
f[파일이름]
문장에 그림(얼굴)을 나타냅니다.
데이터베이스 picture에 해당파일이 있어야 합니다.
f[NOME,n]
얼굴 그래픽의 특정부분을 나타냅니다.
(별쓸모 없으니 안쓰는게 더낮습니다.)
--------------------------------------------------------------------------------
s[n]
문장이 나타내는 속도를 나타냅니다.
숫자가 낮을수록 더 빠릅니다.
[n] 0 ~ 19
--------------------------------------------------------------------------------
해당 변수의 값을 표시합니다.
v[n]
기본적으로 존재하는 문장시스템.
--------------------------------------------------------------------------------
소지금 표시
g
--------------------------------------------------------------------------------
폰트를 ITÁLICO 로 변경합니다.
I
--------------------------------------------------------------------------------
한번더 결정키를 눌러야 문장이 나타납니다.
!
--------------------------------------------------------------------------------
문장이 저절로 닫힙니다.
~
--------------------------------------------------------------------------------
데이터 베이스에 있는 액터 케릭명을 불러옵니다.
n[n]
예 : n[1] = 아르시스
역시나 이것도 기본적으로 있는 문장시스템 입니다.
--------------------------------------------------------------------------------
문장의 색깔을 결정합니다.
c[n]
이것도 기본적으로 있는거라 생략합니다.
--------------------------------------------------------------------------------
pass
문장이 나타나는 도중에도 케릭터가 움직일수 있습니다.
--------------------------------------------------------------------------------
V[]
데이터 베이스에 있는 무기, 방어구, 아이템 이름과 아이콘을 함께 표시합니다.
i = 아이템
w = 무기
a = 방어구
자세한것은 사용예제를 보시길 바랍니다.
--------------------------------------------------------------------------------
이 부분은 뭔지는 알것같지만 그다지 중요한것 같지 않으므로 넘어갑니다.
e[n]
Apresenta uma letra em pictures de 24x24, permitindo a possibilidades de
colocar qualquer tipo caractere que desejar, inclusive com textura.
É necessário ter uma imagem com o nome de Gaiji.png na pasta pictures.
A imagem deve ter de 24 de altura, por X de largura.
O n é a posição que o script vai ler o arquivo de imagem, ou seja,caso
colocarmos o código e[2] o mensagem vai apresentar a imagem do arquivo na
posição 60 de largura.
--------------------------------------------------------------------------------
=end
class Window_Message < Window_Selectable
# 이 부분에서 폰트를 변경할수 있습니다.
DEFAULT_FONT_NAME = "렉시굴림" #원본 : Arial
# 글자 크기를 결정합니다.
DEFAULT_FONT_SIZE = 22
# 문장을 뛰어 쓸때 간격을 조절합니다.
DEFAULT_LINE_SPACE = 30
# 메세지가 나타날때 그림을 함께 표시합니다.
DEFAULT_BG_PICTURE = ""
# 가로 이미지 위치.
DEFAULT_BG_X = 0
# 세로 이미지 위치.
DEFAULT_BG_Y = 320
# Rect.new (X(80), Y(304), L(496), A(160))
# X = 가로 위치.
# Y = 세로 위치.
# L = 창의 폭.
# A = 창의 길이.
DEFAULT_RECT = Rect.new(80, 304, 496, 160)
# 메세지 윈도우의 투명성을 설정합니다. ( 0~255 )
DEFAULT_BACK_OPACITY = 160
# 창의 크기조정.
#além dos limites do tamanho da janela, o script vai ajustar
#automaticamente o tamanho da janela conforme o tamanho da fonte e
#a quantidade de letras, coloque true ou false.
DEFAULT_STRETCH_ENABLE = true
# Extender tamanho da janela.
INFO_RECT = Rect.new(-16, 64, 672, DEFAULT_LINE_SPACE + 40)
# Janela de informação
# Rect.new (X, Y, L, A, DEFAULT_LINE_SPACE)
# X = Posição na horizontal.
# Y = Posição na vertical.
# L = Largura da janela.
# A = Altura da janela.
# DEFAULT_LINE_SPACE = Espaço entre as extremidades da linha.
DEFAULT_TYPING_ENABLE = true
#글자가 나타날 때마다 SE 소리가 재생됩니다.
SOUNDNAME_ON_SPEAK = "001-System01"
# Definição do nome do arquivo de som .
KEY_SHOW_ALL = Input::B
# 문장을 스킵하는 키.
KEY_MESSAGE_SKIP = Input::L
# Pular a próxima mensagem.
HISKIP_ENABLE_SWITCH_ID = 0
# Definição da Switch que ativará a apresentação instantânea da mensagem.
SKIP_BAN_SWITCH_ID = 0
# Definição da Switch que cancela a função das teclas B, L e S
FACE_STRETCH_ENABLE = true # Extender o tamanho da face.
FACE_WIDTH = 100 # Largura da face.
FACE_HEIGHT = 100 # Altura da face.
CHARPOP_HEIGHT = 96 # 48
end
module XRXS9
NAME_WINDOW_TEXT_COLOR = Color.new(192,240,255,255) # Cor da fonte.
NAME_WINDOW_TEXT_SIZE = 20 # Tamanho da fonte.
NAME_WINDOW_SPACE = 10 # Espaço da janela.
NAME_WINDOW_OFFSET_X = 0 # Posição X.
NAME_WINDOW_OFFSET_Y = -26 # Posição Y.
FOBT_DURATION = 40 # Tempo de fade.
end
class Window_Message < Window_Selectable
LEFT = 0
CENTER = 1
RIGHT = 2
def line_height
return DEFAULT_LINE_SPACE
end
alias xrxs9_initialize initialize
def initialize
@stand_pictuers = []
@held_windows = []
@extra_windows = []
@extra_sprites = []
xrxs9_initialize
@opacity_text_buf = Bitmap.new(32, 32)
end
alias xrxs9_dispose dispose
def dispose
@held_windows.each {|window| window.dispose}
@held_windows.clear
if @gaiji_cache != nil and not @gaiji_cache.disposed?
@gaiji_cache.dispose
end
unless @opacity_text_buf.disposed?
@opacity_text_buf.dispose
end
xrxs9_dispose
end
alias xrxs9_terminate_message terminate_message
def terminate_message
@passable = false
$game_player.messaging_moving = false
if @bgframe_sprite != nil
@bgframe_sprite.dispose
end
if @window_hold
@held_windows.push(Window_Copy.new(self))
for window in @extra_windows
next if window.disposed?
@held_windows.push(Window_Copy.new(window))
end
for sprite in @extra_sprites
next if sprite.disposed?
@held_windows.push(Sprite_Copy.new(sprite))
end
self.opacity = 0
self.contents_opacity = 0
@extra_windows.clear
@extra_sprites.clear
else
@held_windows.each {|object| object.dispose}
@held_windows.clear
end
if @name_window_frame != nil
@name_window_frame.dispose
@name_window_frame = nil
end
if @name_window_text != nil
@name_window_text.dispose
@name_window_text = nil
end
xrxs9_terminate_message
end
def pop_character=(character_id)
@pop_character = character_id
end
def pop_character
return @pop_character
end
def clear
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = DEFAULT_FONT_SIZE
self.contents.font.name = DEFAULT_FONT_NAME if DEFAULT_FONT_NAME != ""
self.opacity = 255
self.back_opacity = DEFAULT_BACK_OPACITY
self.contents_opacity = 255
@mid_stop = false
@face_file = nil
@current_name = nil
@window_hold = false
@stand_pictuer_hold = false
@passable = false
@inforesize = false
@x = @y = @indent = @line_index = 0
@cursor_width = @write_speed = @write_wait = @lines_max = 0
@line_widths = []
@line_aligns = []
self.pop_character = nil
end
def refresh
if DEFAULT_BG_PICTURE != ""
bitmap = RPG::Cache.picture(DEFAULT_BG_PICTURE)
@bgframe_sprite = Sprite.new
@bgframe_sprite.x = DEFAULT_BG_X
@bgframe_sprite.y = DEFAULT_BG_Y
@bgframe_sprite.bitmap = bitmap
@bgframe_sprite.z += 5
end
self.clear
if $game_temp.message_text != nil
@now_text = $game_temp.message_text
if (/\_n/.match(@now_text)) != nil
$game_temp.choice_start -= 1
@now_text.gsub!(/\_n/) { "" }
end
if (/[Ff][(.+?)(,*?)([0-9]*?)]/.match(@now_text)) != nil
if RPG_FileTest.picture_exist?($1)
@face_file = $1 + ".png"
@face_index = $3.to_i
src = RPG::Cache.picture(@face_file)
if $2 == ""
@face_index = -1
end
if FACE_STRETCH_ENABLE
@indent += FACE_WIDTH
elsif $2 == ""
@indent += src.width
else
@indent += src.width/4
end
end
@now_text.gsub!(/[Ff][(.*?)]/) { "" }
end
@inforesize = (@now_text.gsub!(/info/) { "" } != nil)
@window_hold = (@now_text.gsub!(/hold/) { "" } != nil)
@now_text.gsub!(/[v][([0-9]+)]/) { $game_variables[$1.to_i].to_s }
begin
last_text = @now_text.clone
@now_text.gsub!(/[V][([IiWwAaSs]?)([0-9]+)]/) { convart_value($1, $2.to_i) }
end until @now_text == last_text
@now_text.gsub!(/[Nn][([0-9]+)]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
if @now_text.sub!(/[Nn]ame[(.*?)]/) { "" }
@current_name = $1
end
if @now_text.gsub!(/[Pp][([0-9]+)]/) { "" }
self.pop_character = $1.to_i
end
if (/ /.match(@now_text)) != nil
$game_temp.choice_start += 1
@now_text.gsub!(/ /) { "n" }
end
if @now_text.gsub!(/fade/) { "" }
@fade_count_before_terminate = XRXS9::FOBT_DURATION
end
if @now_text.gsub!(/pass/) { "" }
@passable = true
$game_player.messaging_moving = true
end
nil while( @now_text.sub!(/nnz/) { "n" } )
@lines_max = @now_text.scan(/n/).size
rxs = [/w[(w+)]/, /[.]/, /[|]/, /[>]/, /[<]/, /[!]/,
/[~]/, /[i]/, /[Oo][([0-9]+)]/, /[Hh][([0-9]+)]/,
/[b][([0-9]+)]/, /[Rr][(.*?)]/, /[B]/, /[I]/]
@max_choice_x = 0
lines = @now_text.split(/n/)
for i in 0..@lines_max
line = lines[@lines_max - i]
next if line == nil
line.gsub!(/[Ee][([0-9]+)]/) { " 22[#{$1}]" }
for rx in rxs
line.gsub!(rx) { "" }
end
@line_aligns[@lines_max - i] =
line.sub!(/center/) {""} ? CENTER :
line.sub!(/ ight/) {""} ? RIGHT :
LEFT
cx = contents.text_size(line).width
@line_widths[@lines_max - i] = cx
end
choices = @line_widths[$game_temp.choice_start, @line_widths.size]
@max_choice_x = choices == nil ? 0 : choices.max + 8
@now_text.gsub!(/center/) {""}
@now_text.gsub!(/ ight/) {""}
@line_aligns[0] = CENTER if @inforesize
if self.pop_character != nil and self.pop_character >= 0
max_x = @line_widths.max
self.width = max_x + 32 #+ @indent + DEFAULT_FONT_SIZE/2
self.height = [@lines_max * line_height, @indent].max + 32
end
@now_text.gsub!(//) { " 00" }
@now_text.gsub!(/[Cc][([0-9]+)]/) { " 01[#{$1}]" }
@now_text.gsub!(/[Gg]/) { " 02" }
@now_text.gsub!(/[Ss][([0-9]+)]/) { " 03[#{$1}]" }
@now_text.gsub!(/[Aa][(.*?)]/) { " 04[#{$1}]" }
@now_text.gsub!(/[.]/) { " 05" }
@now_text.gsub!(/[|]/) { " 06" }
@now_text.gsub!(/[>]/) { " 16" }
@now_text.gsub!(/[<]/) { " 17" }
@now_text.gsub!(/[!]/) { " 20" }
@now_text.gsub!(/[~]/) { " 21" }
@now_text.gsub!(/[Ee][([0-9]+)]/) { " 22[#{$1}]" }
@now_text.gsub!(/[i]/) { " 23" }
@now_text.gsub!(/[Oo][([0-9]+)]/) { " 24[#{$1}]" }
@now_text.gsub!(/[Hh][([0-9]+)]/) { " 25[#{$1}]" }
@now_text.gsub!(/[b][([0-9]+)]/) { " 26[#{$1}]" }
@now_text.gsub!(/[Rr][(.*?)]/) { " 27[#{$1}]" }
@now_text.gsub!(/[B]/) { " 31" }
@now_text.gsub!(/[I]/) { " 32" }
reset_window
if @current_name != nil
self.contents.font.size = XRXS9::NAME_WINDOW_TEXT_SIZE
x = self.x + XRXS9::NAME_WINDOW_OFFSET_X
y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y
w = self.contents.text_size(@current_name).width + 8 + XRXS9::NAME_WINDOW_SPACE
h = 26 + XRXS9::NAME_WINDOW_SPACE
@name_window_frame = Window_Base.new(x, y, w, h)
@name_window_frame.opacity = 160
@name_window_frame.z = self.z + 2
x = self.x + XRXS9::NAME_WINDOW_OFFSET_X + 3 + XRXS9::NAME_WINDOW_SPACE / 2
y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y + 1 + XRXS9::NAME_WINDOW_SPACE / 2
@name_window_text = Air_Text.new(x,y, @current_name, XRXS9::NAME_WINDOW_TEXT_SIZE, XRXS9::NAME_WINDOW_TEXT_COLOR)
@name_window_text.z = self.z + 3
self.contents.font.size = DEFAULT_FONT_SIZE
@extra_windows.push(@name_window_frame)
@extra_windows.push(@name_window_text)
end
end
reset_window
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.color = normal_color
self.contents.font.name = DEFAULT_FONT_NAME if DEFAULT_FONT_NAME != ""
unless @face_file.nil?
src = RPG::Cache.picture(@face_file)
if @face_index == -1
w = src.width
h = src.height
x = 0
y = 0
else
w = src.width/4
h = src.height/4
x = (@face_index-1) % 4 * w
y = (@face_index-1) / 4 * h
end
if FACE_STRETCH_ENABLE
self.contents.stretch_blt(Rect.new(0,0,FACE_WIDTH,FACE_HEIGHT), src, Rect.new(x, y, w, h))
else
self.contents.blt(0, 0, src, Rect.new(x, y, w, h))
end
end
if $game_temp.choice_max > 0
@item_max = $game_temp.choice_max
self.active = true
self.index = 0
end
if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
@input_number_window.x = self.x + 8 + @indent
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
self.contents.font.size = DEFAULT_FONT_SIZE
line_reset
update unless DEFAULT_TYPING_ENABLE
end
def line_reset
case @line_aligns[@line_index]
when LEFT
@x = @indent
@x += 8 if $game_temp.choice_start <= @line_index
when CENTER
@x = self.width / 2 - 16 - @line_widths[@line_index].to_i / 2
when RIGHT
@x = self.width - 40 - @line_widths[@line_index].to_i
end
end
def update
if @passable and not $game_player.messaging_moving
self.opacity = 0
terminate_message
return
end
super
update_main
end
def update_main
if !self.pop_character.nil? and self.pop_character >= 0
update_reset_window
end
if skippable_now? and Input.press?(KEY_MESSAGE_SKIP)
self.contents_opacity = 255
@fade_in = false
elsif @fade_in
self.contents_opacity += 24
if @input_number_window != nil
@input_number_window.contents_opacity += 24
end
if self.contents_opacity == 255
@fade_in = false
end
return
end
@now_text = nil if @now_text == ""
if @now_text != nil and @mid_stop == false
if @write_wait > 0
@write_wait -= 1
return
end
text_not_skip = DEFAULT_TYPING_ENABLE
while true
if (c = @now_text.slice!(/./m)) != nil
if c == " 00"
c = ""
end
if c == " 01"
@now_text.sub!(/[([0-9]+)]/, "")
color = $1.to_i
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
if @opacity != nil
color = self.contents.font.color
self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
end
end
c = ""
end
if c == " 02"
if @gold_window == nil
@gold_window = Window_Gold.new
@gold_window.x = 560 - @gold_window.width
if $game_temp.in_battle
@gold_window.y = 192
else
@gold_window.y = self.y >= 128 ? 32 : 384
end
@gold_window.opacity = self.opacity
@gold_window.back_opacity = self.back_opacity
end
c = ""
end
if c == " 03"
@now_text.sub!(/[([0-9]+)]/, "")
speed = $1.to_i
if speed >= 0 and speed <= 19
@write_speed = speed
end
c = ""
end
if c == " 05"
@write_wait += 5
c = ""
end
if c == " 06"
@write_wait += 20
c = ""
end
if c == " 16"
text_not_skip = false
c = ""
end
if c == " 17"
text_not_skip = true
c = ""
end
if c == " 20"
@mid_stop = true
c = ""
end
if c == " 21"
terminate_message
return
end
if c == " 23"
@indent = @x
c = ""
end
if c == " 24"
@now_text.sub!(/[([0-9]+)]/, "")
@opacity = $1.to_i
color = self.contents.font.color
self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
c = ""
end
if c == " 25"
@now_text.sub!(/[([0-9]+)]/, "")
self.contents.font.size = [[$1.to_i, 6].max, 32].min
c = ""
end
if c == " 26"
@now_text.sub!(/[([0-9]+)]/, "")
@x += $1.to_i
c = ""
end
if c == " 27"
process_ruby
if SOUNDNAME_ON_SPEAK != ""
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
c = ""
end
if c == " 30"
@now_text.sub!(/[(.*?)]/, "")
self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
if SOUNDNAME_ON_SPEAK != ""
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
@x += 24
c = ""
end
if c == "n"
@y += 1
@line_index += 1
line_reset
if @line_index >= $game_temp.choice_start
@cursor_width = @max_choice_x
end
c = ""
end
if c == " 22"
@now_text.sub!(/[([0-9]+)]/, "")
@x += draw_gaiji(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i)
if SOUNDNAME_ON_SPEAK != "" then
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
c = ""
end
if c == " 31"
self.contents.font.bold ^= true
c = ""
end
if c == " 32"
self.contents.font.italic ^= true
c = ""
end
if c != ""
self.contents.draw_text(4+@x, line_height * @y, 40, line_height, c)
@x += self.contents.text_size(c).width
if SOUNDNAME_ON_SPEAK != "" then
Audio.se_play("Audio/SE/" + SOUNDNAME_ON_SPEAK)
end
end
if skippable_now? and
(Input.press?(KEY_SHOW_ALL) or Input.press?(KEY_MESSAGE_SKIP)) and
(SKIP_BAN_SWITCH_ID == 0 ? true : !$game_switches[SKIP_BAN_SWITCH_ID])
text_not_skip = false
end
else
text_not_skip = true
break
end
break if text_not_skip
end
@write_wait += @write_speed
return
end
if @input_number_window != nil
@input_number_window.update
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
$game_map.need_refresh = true
@input_number_window.dispose
@input_number_window = nil
terminate_message
end
return
end
if @contents_showing
if $game_temp.choice_max == 0
self.pause = true
end
unless @fade_phase_before_terminate
if Input.trigger?(Input::B)
if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
$game_system.se_play($data_system.cancel_se)
$game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
terminate_message
return
end
end
if Input.trigger?(Input::C) or
(skippable_now? and Input.press?(KEY_MESSAGE_SKIP))
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
if @mid_stop
@mid_stop = false
return
elsif @fade_count_before_terminate.to_i > 0
@fade_phase_before_terminate = true
else
terminate_message
end
end
end
if @fade_phase_before_terminate
@fade_count_before_terminate = 0 if @fade_count_before_terminate == nil
@fade_count_before_terminate -= 1
opacity = @fade_count_before_terminate * (256 / XRXS9::FOBT_DURATION)
self.contents_opacity = opacity
if @fade_count_before_terminate <= 0
@fade_count_before_terminate = 0
@fade_phase_before_terminate = false
terminate_message
end
end
return
end
if @fade_out == false and $game_temp.message_text != nil
@contents_showing = true
$game_temp.message_window_showing = true
refresh
Graphics.frame_reset
self.visible = true
self.contents_opacity = 0
if @input_number_window != nil
@input_number_window.contents_opacity = 0
end
@fade_in = true
return
end
if self.visible
@fade_out = true
self.opacity -= 48
if self.opacity == 0
self.visible = false
@fade_out = false
$game_temp.message_window_showing = false
end
return
end
end
def reset_window
if @inforesize
RectalCopy.copy(self, INFO_RECT)
elsif self.pop_character != nil and self.pop_character >= 0
update_reset_window
else
RectalCopy.copy(self, DEFAULT_RECT)
case ($game_temp.in_battle ? 0 : $game_system.message_position)
when 0
self.y = [16, -XRXS9::NAME_WINDOW_OFFSET_Y + 4].max
when 1
self.y = 160
end
if DEFAULT_STRETCH_ENABLE and @lines_max >= 4
d = @lines_max * DEFAULT_LINE_SPACE + 32 - self.height
if d > 0
self.height += d
case $game_system.message_position
when 1
self.y -= d/2
when 2
self.y -= d
end
end
end
if @face_file != nil
self.width += FACE_WIDTH
self.x -= FACE_WIDTH/2
end
end
if $game_system.message_frame == 0
self.back_opacity = DEFAULT_BACK_OPACITY
@name_window_frame.back_opacity = DEFAULT_BACK_OPACITY unless @name_window_frame.nil?
else
self.opacity = 0
@name_window_frame.back_opacity = 0 unless @name_window_frame.nil?
end
end
def update_reset_window
if self.pop_character == 0 or $game_map.events[self.pop_character] != nil
character = get_character(self.pop_character)
x = character.screen_x - self.width / 2
case $game_system.message_position
when 0
if @name_window_frame != nil and @name_window_frame.y <= 4
y = 4 - XRXS9::NAME_WINDOW_OFFSET_Y
else
y = character.screen_y - CHARPOP_HEIGHT - self.height
end
else
y = character.screen_y
end
self.x = [[x, 4].max, 636 - self.width ].min
self.y = [[y, 4].max, 476 - self.height].min
if @name_window_frame != nil
@name_window_frame.x = self.x + XRXS9::NAME_WINDOW_OFFSET_X
@name_window_frame.y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y
@name_window_text.x = self.x + XRXS9::NAME_WINDOW_OFFSET_X + 1 + XRXS9::NAME_WINDOW_SPACE/2 - 16
@name_window_text.y = self.y + XRXS9::NAME_WINDOW_OFFSET_Y + 1 + XRXS9::NAME_WINDOW_SPACE/2 - 16
end
end
end
def update_cursor_rect
if @index >= 0
n = $game_temp.choice_start + @index
self.cursor_rect.set(8 + @indent, n * line_height, @cursor_width, line_height)
else
self.cursor_rect.empty
end
end
def get_character(parameter)
case parameter
when 0
return $game_player
else
events = $game_map.events
return events == nil ? nil : events[parameter]
end
end
def skippable_now?
return ((SKIP_BAN_SWITCH_ID == 0 ? true : !$game_switches[SKIP_BAN_SWITCH_ID]) and
(HISKIP_ENABLE_SWITCH_ID == 0 ? true : $game_switches[HISKIP_ENABLE_SWITCH_ID]))
end
def visible=(b)
@name_window_frame.visible = b unless @name_window_frame.nil?
@name_window_text.visible = b unless @name_window_text.nil?
@input_number_window.visible = b unless @input_number_window.nil?
super
end
def process_ruby
end
def draw_gaiji(x, y, num)
end
def convart_value(option, index)
end
end
class Air_Text < Window_Base
def initialize(x, y, designate_text, size, text_color)
super(x-16, y-16, 32 + designate_text.size * 12, 56)
self.opacity = 0
self.contents = Bitmap.new(self.width - 32, self.height - 32)
w = self.contents.width
h = self.contents.height
self.contents.font.size = size
self.contents.font.color = text_color
self.contents.draw_text(0, 0, w, h, designate_text)
end
end
class Window_Copy < Window_Base
def initialize(window)
super(window.x, window.y, window.width, window.height)
self.contents = window.contents.dup unless window.contents.nil?
self.opacity = window.opacity
self.back_opacity = window.back_opacity
self.z = window.z
end
end
class Sprite_Copy < Sprite
def initialize(sprite)
super()
self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
self.opacity = sprite.opacity
self.x = sprite.x
self.y = sprite.y
self.z = sprite.z
self.ox = sprite.ox
self.oy = sprite.oy
end
end
class Interpreter
def command_101
if $game_temp.message_text != nil
return false
end
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
$game_temp.message_text = @list[@index].parameters[0] + "n"
line_count = 1
loop do
if @list[@index+1].code == 401
$game_temp.message_text += @list[@index+1].parameters[0] + "n"
line_count += 1
else
if @list[@index+1].code == 101
if (/ extZ/.match($game_temp.message_text)) != nil
$game_temp.message_text.gsub!(/ ext/) { "" }
$game_temp.message_text += @list[@index+1].parameters[0] + "n"
@index += 1
next
end
elsif @list[@index+1].code == 102
if @list[@index+1].parameters[0].size <= 4 - line_count
@index += 1
$game_temp.choice_start = line_count
setup_choices(@list[@index].parameters)
end
elsif @list[@index+1].code == 103
if line_count < 4
@index += 1
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
return true
end
@index += 1
end
end
end
class Game_Player < Game_Character
attr_accessor :messaging_moving
end
module RectalCopy
def self.copy(rect1, rect2)
rect1.x = rect2.x
rect1.y = rect2.y
rect1.width = rect2.width
rect1.height = rect2.height
end
end
#--------------------------------------------------------------------------
class Window_Message < Window_Selectable
#위에 설명해서 말했던 e[n] 관련 스크립트 입니다.
GAIJI_FILE = "gaiji.png" # Nome do arquivo de imagem.
GAIJI_SIZE = 24 # Tamanho de leitura da imagem.
end
class Interpreter
def pretend_stopping=(b)
@pretend_stopping = b
end
alias xrxs9_running? running?
def running?
return (not @pretend_stopping and xrxs9_running?)
end
end
class Game_Player < Game_Character
alias xrxs9_update update
def update
return xrxs9_update unless @messaging_moving
last_showing = $game_temp.message_window_showing
$game_system.map_interpreter.pretend_stopping = true
$game_temp.message_window_showing = false
xrxs9_update
$game_temp.message_window_showing = last_showing
$game_system.map_interpreter.pretend_stopping = nil
end
end
class Game_Event < Game_Character
alias xrxs9_start start
def start
xrxs9_start
if @starting and $game_player.messaging_moving
$game_player.messaging_moving = false
end
end
end
class Window_Message < Window_Selectable
def draw_gaiji(x, y, num)
if @gaiji_cache == nil
if RPG_FileTest.picture_exist?(GAIJI_FILE)
@gaiji_cache = RPG::Cache.picture(GAIJI_FILE)
else
return 0
end
end
if @gaiji_cache.width < num * GAIJI_SIZE
return 0
end
size = GAIJI_SIZE
self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * GAIJI_SIZE, 0, GAIJI_SIZE, GAIJI_SIZE))
if SOUNDNAME_ON_SPEAK != "" then
Audio.se_play(SOUNDNAME_ON_SPEAK)
end
return size
end
def convart_value(option, index)
option == nil ? option = "" : nil
option.downcase!
case option
when "i"
unless $data_items[index].name == nil
r = sprintf(" 30[%s]%s", $data_items[index].icon_name, $data_items[index].name)
end
when "w"
unless $data_weapons[index].name == nil
r = sprintf(" 30[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
end
when "a"
unless $data_armors[index].name == nil
r = sprintf(" 30[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
end
when "s"
unless $data_skills[index].name == nil
r = sprintf(" 30[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
end
else
r = $game_variables[index]
end
r == nil ? r = "" : nil
return r
end
end
class Window_Message < Window_Selectable
def process_ruby
@now_text.sub!(/[(.*?)]/, "")
x = @x
y = @y * line_height
w = 40
h = line_height
@x += self.contents.draw_ruby_text(x, y, w, h, $1)
end
end
class Bitmap
def draw_ruby_text(x, y, w, h, str)
sizeback = self.font.size
self.font.size * 3 / 2 > 32 ? rubysize = 32 - self.font.size : rubysize = self.font.size / 2
rubysize = [rubysize, 6].max
split_s = str.split(/,/)
split_s[0] = "" if split_s[0] == nil
split_s[1] = "" if split_s[1] == nil
height = sizeback + rubysize
width = self.text_size(split_s[0]).width
self.font.size = rubysize
ruby_width = self.text_size(split_s[1]).width
self.font.size = sizeback
buf_width = [self.text_size(split_s[0]).width, ruby_width].max
width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
self.font.size = rubysize
self.draw_text(x + sub_x, 4 + y - self.font.size, self.text_size(split_s[1]).width, self.font.size, split_s[1])
self.font.size = sizeback
self.draw_text(x, y, width, h, split_s[0])
return width
end
end
#-------------------------------------------------------------------------------
module XRXS9
BACKLOG_KEY = Input::Y # 메세지 로그 S 키로 사용합니다.
BACKLOG_MAX_HEIGHT = 1600 # 로그 최대높이.
BACKLOG_MAX_INDEX = 12 # 문자 최대수?
end
class Window_Message < Window_Selectable
alias xrxs9ax_initialize initialize
def initialize
xrxs9ax_initialize
@log_window = Window_MessageLog.new
@log_window.z = self.z + 100
end
alias xrxs9ax_terminate_message terminate_message
def terminate_message
@log_window.add_log(@current_name, self.contents)
xrxs9ax_terminate_message
end
alias xrxs9ax_update_main update_main
def update_main
if Input.trigger?(XRXS9::BACKLOG_KEY) and $game_temp.message_window_showing
self.visible = false
@log_window.show
self.visible = true
return
end
xrxs9ax_update_main
end
end
class Window_MessageLog < Window_Base
def initialize
super(0,0,640,480)
self.visible = false
self.back_opacity = 160
self.contents = Bitmap.new(width - 32, XRXS9::BACKLOG_MAX_HEIGHT)
self.contents.font.color = XRXS9::NAME_WINDOW_TEXT_COLOR
self.contents.font.size = XRXS9::NAME_WINDOW_TEXT_SIZE
@names = []
@contetns = []
end
def show
self.refresh
self.visible = true
loop do
Graphics.update
Input.update
self.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
self.visible = false
break
end
end
end
def update
super
if Input.repeat?(Input::UP) and self.oy >= 32
$game_system.se_play($data_system.cursor_se)
self.oy -= 32
return
end
if Input.repeat?(Input::DOWN) and self.oy <= XRXS9::BACKLOG_MAX_HEIGHT - 448
$game_system.se_play($data_system.cursor_se)
self.oy += 32
return
end
end
def cut_excess(limit_index)
for i in limit_index...@contetns.size
next if @contetns[i].nil?
@contetns[i].dispose
@contetns[i] = nil
@names[i] = nil
end
@contetns.compact!
@names.compact!
end
def add_log(name, contents)
@names.insert(0, name.to_s)
@contetns.insert(0, contents.dup)
cut_excess(XRXS9::BACKLOG_MAX_INDEX)
end
def refresh
y = XRXS9::BACKLOG_MAX_HEIGHT
index = 0
self.contents.clear
loop do
contents = @contetns[index]
if contents.nil? or y <= 0
break
end
self.contents.blt(4, y - contents.height, contents, contents.rect)
y -= contents.height
self.contents.draw_text(4, y-24, 600, 24, @names[index].to_s)
y -= 32
index += 1
end
cut_excess(index)
self.oy = XRXS9::BACKLOG_MAX_HEIGHT - 416
end
def dispose
for contents in @contetns
next if contents.nil?
contents.dispose
end
super
end
end
#------------------------------------------------------------------------------
module XRXS9C
SWITCH_ID = 50 #스위치를 변경합니다.
RECT = Rect.new(0,400,640,96)#X,Y,H,L,D 믄장이 나타나는 위치를 설정합니다.
end
class Window_Message < Window_Selectable
alias xrxs9c_reset_window reset_window
def reset_window
if $game_switches[XRXS9C::SWITCH_ID]
RectalCopy.copy(self, XRXS9C::RECT)
self.opacity = 0
@line_aligns[0] = CENTER
@line_aligns[1] = CENTER
return
end
xrxs9c_reset_window
end
end
class Scene_Map
alias xrxs9c_main main
def main
black = Color.new(0,0,0,255) #투명색 설정.
@cinemasks = []
mask = Sprite.new
mask.bitmap = Bitmap.new(640,48)
mask.bitmap.fill_rect(0,0,640,48, black) #위부분 투명색 설정.
mask.x = 0
mask.y = -48
mask.z = 5001
@cinemasks[0] = mask
mask = Sprite.new
mask.bitmap = Bitmap.new(640,72)
mask.bitmap.fill_rect(0,0,640,72, black) #아래부분 투명색 설정.
mask.x = 0
mask.y = 480
mask.z = 5001
@cinemasks[1] = mask
mask = Sprite.new
mask.bitmap = Bitmap.new(640,480)
mask.bitmap.fill_rect(0,0,640,480, black) #바뀌는 색조값 설정.
mask.x = 0
mask.y = 0
mask.z = 199
mask.opacity = 0
@cinemasks[2] = mask
@cinema_fadecount = 24
xrxs9c_main
@cinemasks.each{|sprite| sprite.dispose }
end
alias xrxs9c_update update
def update
update_cinema
xrxs9c_update
end
def update_cinema
if ( $game_switches[XRXS9C::SWITCH_ID] and @cinema_fadecount > 0) or
(not $game_switches[XRXS9C::SWITCH_ID] and @cinema_fadecount < 24)
@cinema_fadecount += ($game_switches[XRXS9C::SWITCH_ID] ? -1 : 1)
@cinemasks[0].y = 0 - 6 * @cinema_fadecount / 3
@cinemasks[1].y = 480 - 9 * (24 - @cinema_fadecount) / 3
@cinemasks[2].opacity = 4 * (24 - @cinema_fadecount)
end
end
end
#-------------------------------------------------------------------------------
class Window_Message < Window_Selectable
def pop_character=(character_id)
@pop_character = character_id
$mes_id = character_id
end
end