Project1
标题:
谁能帮我简单化对话框加强脚本
[打印本页]
作者:
aaasss955
时间:
2007-6-17 02:27
标题:
谁能帮我简单化对话框加强脚本
\n[1]:显示1号角色的姓名
\m[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
\m[\n[1]]:显示一号人物名子的方框
我只要这几种功能就好,其他不要
#==============================================================================
# ◎ GPRA_Window_Message
#------------------------------------------------------------------------------
# ◎ 顯示文章的信息窗口加強。
#------------------------------------------------------------------------------
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化狀態
#--------------------------------------------------------------------------
def initialize
# super(60,304,520,160)
super(135,304,500,160)
self.contents = Bitmap.new(width - 32,height - 32)
self.visible = false
self.z = 9998
@fade_in = false
@fade_out = false
@contents_showing = false
@cursor_width = 0
@op = 255 # 不透明度
@head_bmp = nil # 裝載頭像用
@head_file = nil # 頭像檔案名
@text = nil # 記錄所處理文字
@skip = false # 記錄是否跳過此次對話
@auto_close = -1 # 預設不打開自動關閉
@type_mode=-1 # 打字模式
@delay=-1 # 等待n畫格標誌
@finish=false # 記錄文字處理是否結束
@is_read_txt =false # 預設不是在讀取txt檔案
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● 釋放
#--------------------------------------------------------------------------
def dispose
terminate_message
$game_temp.message_window_showing = false
if @input_number_window != nil
@input_number_window.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 處理信息結束
#--------------------------------------------------------------------------
def terminate_message
#以下為增加姓名框處理
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
#以上為增加姓名框處理
self.active = false
self.pause = false
self.index = -1
self.contents.clear
# 清除顯示中標誌
@contents_showing = false
# 呼叫信息調用
if $game_temp.message_proc != nil
$game_temp.message_proc.call
end
# 清除文章,選擇項,輸入數值的相關變量
$game_temp.message_text = nil
$game_temp.message_proc = nil
$game_temp.choice_start = 99
$game_temp.choice_max = 0
$game_temp.choice_cancel_type = 0
$game_temp.choice_proc = nil
$game_temp.num_input_start = 99
$game_temp.num_input_variable_id = 0
$game_temp.num_input_digits_max = 0
# 開放金錢窗口
if @gold_window != nil
@gold_window.dispose
@gold_window = nil
end
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
# 清空原先內容
self.contents.clear
# 恢復一般字色
self.contents.font.color = normal_color
# 恢復字體大小
self.contents.font.size = 20
# 繪製文字位置初始化
@x = @y = 0
# 字體高度記錄
@height = 32
# 文字不透明度設定為255
@op = 255
# 頭像預設顯示在右邊
@right = true
# 頭像預設顯示一般表情
@face = nil
# 預設顯示角色姓名
@name = nil
# 預設不跳過此次對話
@skip = false
# 從變量讀取自動關閉設置
@auto_close = $game_variables[102]
# 從變量讀取打字模式設置
@type_mode=$game_variables[103]
# 預設不等待
@delay=-1
# 設定文字沒有處理結束
@finish=false
# 光標寬度初始化為零
@cursor_width = 0
# 到選擇項的下一行字
if $game_temp.choice_start == 0
@x = 16
end
# 有等待顯示的文字的情況下
# (註:因為一旦文字非空就處理,所以可以設定 $game_temp.message_text 達到顯示文章的效果)
if $game_temp.message_text != nil
# # @text 功能改進
# if @text==nil or @text==""
# @text = $game_temp.message_text.dup
# else
# @text = @text + $game_temp.message_text
# end
#以下為對話記錄
clue = $game_temp.message_text.split(/@clu/)[1]
if clue != nil
if @text==nil
@text = $game_temp.message_text.split(/@/)[0]
else
@text = @text + $game_temp.message_text.split(/@/)[0]
end
# @text = $game_temp.message_text.split(/@/)[0]
if $game_variables[36].include?($game_variables[3])==false
$game_variables[36][$game_variables[3]]={}
end#當前魔塔編號不存在就創建它
if $game_variables[36][$game_variables[3]].include?($game_variables[2])==false
$game_variables[36][$game_variables[3]][$game_variables[2]]=[]
end#當前魔塔編號當前樓層不存在就創建它
if $game_variables[36][0].include?($game_variables[3])==false
$game_variables[36][0][$game_variables[3]]=0
end#當前魔塔編號對話記錄次數不存在就創建它
if $game_variables[36][$game_variables[3]][1000]==nil
$game_variables[36][$game_variables[3]][1000]=[]
end#當前魔塔編號對話記錄順序排列不存在就創建它
# p $game_temp.message_text.split(/@/)[0]
# p $game_variables[36][$game_variables[3]][$game_variables[2]].include?($game_temp.message_text.split(/@/)[0])
if $game_variables[36][$game_variables[3]][$game_variables[2]].include?($game_temp.message_text.split(/@/)[0])==false
$game_variables[36][$game_variables[3]][$game_variables[2]].push ($game_temp.message_text.split(/@/)[0])
$game_variables[36][0][$game_variables[3]]+=1# 已知的對話條數
@j=0
for i in 0...$game_variables[2]+1
if $game_variables[36][$game_variables[3]].include?(i)
@j+=$game_variables[36][$game_variables[3]][i].size
end
end
@j-=1
@j=0 if @j<=0
$game_variables[36][$game_variables[3]][1000].insert @j,[$game_variables[2],$game_variables[36][$game_variables[3]][$game_variables[2]][$game_variables[36][$game_variables[3]][$game_variables[2]].size-1]]
end
else
if @text==nil
@text = $game_temp.message_text.dup
else
@text = @text + $game_temp.message_text
end
# @text = $game_temp.message_text
end
#以上為對話記錄
# 最先必須要將 "\\\\" 變換為 "\000"
@text.gsub!(/\\\\/) { "\000" }
# 在TXT模式還沒有打開的時候
if !@is_read_txt
# TXT讀取模式打開
if @text.slice!(/\\[Tt][Xx][Tt]\[(\w+)\]\[(\w+)\]/)!=nil
# 打開檔案,成功打開後再進入後面部分
if @ts.open($1,$2)
# 根據顯示模式確定需要打開行數
case $game_variables[1]
when 0 # 正常模式
@text = @ts.get_text(4)
when 1 # 圖書模式
@text = @ts.get_text(12)
when 2 # 全螢幕模式
@text = @ts.get_text(15)
end
# 如果包含[END]
if @text.gsub!(/\[END\]/){""}!=nil
#退出TXT讀取模式
@is_read_txt=false
else
#否則設置正在讀取標誌
@is_read_txt=true
end
end
else
if @text.slice!(/\\[Tt][Xx][Tt]\[(\w+)\]/)!=nil
# 打開檔案,成功打開後再進入後面部分
if @ts.open($1,"")
# 根據顯示模式確定需要打開行數
case $game_variables[101]
when 0 # 正常模式
@text = @ts.get_text(4)
when 1 # 圖書模式
@text = @ts.get_text(12)
when 2 # 全螢幕模式
@text = @ts.get_text(15)
end
# 如果包含[END]
if @text.gsub!(/\[END\]/){""}!=nil
#退出TXT讀取模式
@is_read_txt=false
else
#否則設置正在讀取標誌
@is_read_txt=true
end
end
end
end
end
# 如果取得的字符含"\\~"時
if @text.slice!(/\\~/)!=nil
# 跳過此次對話
terminate_message
# 設置跳過此次對話標誌
@skip = true
# 直接返回等待連接後面部分
return
end
# 限制文字處理(註:這裡是預設功能。)
begin
last_text = @text.clone
@text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until @text == last_text
@text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
#(註:後面將單個字符循環判斷,所以這裡將控制符全部換成單個字符)
# 為了方便將 "\\C" 變為 "\001"
@text.gsub!(/\\[Cc]\[([0-9#a-zA-Z]+)\]/) { "\001[#{$1}]" }
# "\\G" 變為 "\002"
@text.gsub!(/\\[Gg]/) { "\002" }
# ========================增強功能========================
#對話加強
@now_text=$game_temp.message_text
name_window_set = false#\m[姓名]在對話框上增加姓名
if (/\\[Mm]\[(.+?)\]/.match(@now_text)) != nil
# name_window_set = true
name_text = $1
@now_text.sub!(/\\[Mm]\[(.*?)\]/) { "" }
end
@text.gsub!(/\\[Mm]\[(.+?)\]/) do
name_window_set = true
name_text = $1
@now_text.sub!(/\\[Mm]\[(.*?)\]/) { "" }
end
#對話加強
# "\\/" 刪除行尾換行符號
@text.gsub!(/\\\/\n/) {""}
# 去掉不在行尾的"\\/"符號,防止出錯
@text.gsub!(/\\\//) {""}
# "\\S" 字體大小(只修改第一個"\\S")
# 這裡首先刪掉能找到的第一個"\\S"
if @text.slice!(/\\[Ss]\[([0-9]+)\]/)!=nil
# 當找了"\\S"時滿足上述條件,就設置文字大小
self.set_font_size($1.to_i)
end
# "\\O" 文字透明度(使用注意同上,模擬聲音變小……)
if @text.slice!(/\\[Oo]\[([0-9]+)\]/)!=nil
self.set_font_op($1.to_i)
end
# "\\=" 停頓固定畫格(延時)
@text.gsub!(/\\=\[([0-9]+)\]/) { "\024[#{$1}]" }
# "\\." 停頓3畫格
@text.gsub!(/\\\./) { "\024[3]" }
# "\\_" 停頓1秒(30畫格)
@text.gsub!(/\\_/) { "\024[30]" }
# "\\L" 指定頭像左邊顯示
if @text.slice!(/\\[Ll]/)!=nil
# 設定頭像居右標誌為假
@right=false
# 順便要設置@x=104,文字在右邊顯示
@x=104
end
# "\\X" 指定不要顯示姓名,帶參數就是指定顯示姓名(可內部使用"\\N[]")
# 首先是尋找有沒有帶參數的"\\X"
if @text.slice!(/\\[Xx]\[(\w+)\]/)!=nil
# 找到的話將參數賦予@name
@name=$1
# 沒有找到的話
else
# 再去尋找有沒有不帶參數的"\\X"
if @text.slice!(/\\[Xx]/)!=nil
# 找到的話就將姓名變成"???"
@name="???"
end
end
# "\\F" 指定表情(Face 用來指定表情啦)
# 這裡"\w"表示匹配字母+數字還有下劃線,同樣支援中文
if @text.slice!(/\\[Ff]\[(\w+)\]/)!=nil
# 找到的話就設定表情
@face=$1
end
# "\\H" 顯示頭像(不明白大家為什麼都喜歡用 Face 表示頭像……)
# 這裡我將把顯示頭像放到字串的最前面,因為頭像應該先顯示出來
if @text.slice!(/\\[Hh]\[([0-9]+)\]/)!=nil
# 找到的話就提到字符串最前面
@text="\030[#{$1}]"+@text
end
# ================ 分析部分結束,下面是顯示部分 ================
# 在此調用過程完成,因為在update部分也會有相同代碼
self.refresh_
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
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
#對話加強
# reset_window
if name_window_set
off_x = 0
off_y = -40
space = 2
x = self.x + off_x - space / 2
y = self.y + off_y - space / 2
w = self.contents.text_size(name_text).width + 26 + space
h = 40 + space
@name_window_frame = Window_Frame.new(x,y,w,h)
@name_window_frame.z = self.z + 1
x = self.x + off_x + 4
y = self.y + off_y
@name_window_text = Air_Text.new(x+4,y+6,name_text)
@name_window_text.z = self.z + 2
end
#對話加強
end
#--------------------------------------------------------------------------
# ● 設置窗口位置與不透明度
#--------------------------------------------------------------------------
def reset_window
# 判斷現在的顯示模式
case $game_variables[101]
when 0 # 普通模式
self.width=480
self.height=160
self.contents = Bitmap.new(width - 32,height - 32)
# self.x = 80
self.x = 145
if $game_temp.in_battle
# self.y = 16
self.y = 50
else
case $game_system.message_position
when 0 # 上
# self.y = 16
self.y = 50
when 1 # 中
self.y = 160
when 2 # 下
self.y = 304
end
end
when 1 # 圖書模式
self.width=532
self.height=416
self.contents = Bitmap.new(width - 32,height - 32)
self.x = 54
self.y = 32
when 2 # 全螢幕模式
self.width=672
self.height=512
self.contents = Bitmap.new(width - 32,height - 32)
self.x = -16
self.y = -16
end
if $game_system.message_frame == 0
self.opacity = 255
else
self.opacity = 0
end
self.back_opacity = 192
end
#--------------------------------------------------------------------------
# ● 刷新畫面
#--------------------------------------------------------------------------
def update
super
# 漸變的情況下
if @fade_in
# 腳本在這裡設定透明度
self.contents_opacity += @op/8
if @input_number_window != nil
@input_number_window.contents_opacity += 32
end
if self.contents_opacity >= @op
@fade_in = false
end
return
end
# 輸入數值的情況下
if @input_number_window != nil
@input_number_window.update
#取消-使輸入框可以被取消
if Input.trigger?(Input::B)
$game_switches[44]=true
$game_system.se_play($data_system.cancel_se)
@input_number_window.dispose
@input_number_window = nil
terminate_message
end#以上為增加的功能
# 確定
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
# 刷新文本
self.refresh_
# 如果不是在顯示選擇項中就顯示暫停標誌
if $game_temp.choice_max == 0
self.pause = true
end
# 取消
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
end
end
# @auto_close自減計數
@auto_close-=1
# 確定或者自動關閉
if Input.trigger?(Input::C) or @auto_close==0 # @auto_close為0自動關閉,所以一開始為負數或0就不會自動關閉
# 文字還沒有處理完的時候
if !@finish
# 刪除所有停頓效果
@text.gsub!(/\024\[([0-9]+)\]/) { "" }
# 刪除當前延遲效果
@delay = 0
# 關閉打字效果
@type_mode=-1
# 一次處理完所有的字
self.refresh_
else
# 有選擇項的情況
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
# 清空文字
terminate_message
# 在讀取TXT的模式下,需要繼續打開文字
if @is_read_txt
# 根據顯示模式確定需要打開行數
case $game_variables[101]
when 0 # 正常模式
$game_temp.message_text = @ts.get_text(4)
when 1 # 圖書模式
$game_temp.message_text = @ts.get_text(12)
when 2 # 全螢幕模式
$game_temp.message_text = @ts.get_text(15)
end
# 如果包含[END]則退出TXT讀取模式
if $game_temp.message_text.gsub!(/\[END\]/){""}!=nil
@is_read_txt=false
end
end
end
end
return
end
# 在漸變以外的狀態下有等待顯示的信息與選擇項的場合
if @fade_out == false and !($game_temp.message_text == nil or $game_temp.message_text == "")
@contents_showing = true
$game_temp.message_window_showing = true
reset_window
refresh
Graphics.frame_reset
# 當不跳過對話時才進行淡入操作
if !@skip
self.visible = true
self.contents_opacity = 0
if @input_number_window != nil
@input_number_window.contents_opacity = 0
end
@fade_in = true
end
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 update_cursor_rect
if @index >= 0
n = $game_temp.choice_start + @index
self.cursor_rect.set(8,n * 32,@cursor_width,32)
else
self.cursor_rect.empty
end
end
#--------------------------------------------------------------------------
# ● 設定字體大小
#--------------------------------------------------------------------------
def set_font_size(size=20)
# 最大字96號,再大就超過文字欄了,而且Ruby本來有限制……
if size>96
size=96
end
# 設定字的大小
self.contents.font.size = size
# 如果字太大了就要加高每行文字高度。
if size > 28
@height=size+4
else
@height=32
end
end
#--------------------------------------------------------------------------
# ● 設定文字透明
#--------------------------------------------------------------------------
def set_font_op(op=255)
# 限制透明度為0-255
if op>255
op=255
elsif op<0
op=0
end
# 這裡設定文字透明是沒有用的,設定透明在update過程開始
@op = op
end
#--------------------------------------------------------------------------
# ● 顯示文字/頭像過程
#--------------------------------------------------------------------------
def refresh_
# 處理已經結束的情況下直接return
if @finish
return
end
# 延時處理
@delay-=1
if @delay<=0
# 每次處理i個標誌,這裡i就設置為@type_mode了
i=@type_mode
# c 獲取 1 個字 (如果不能取得文字就循環)
while ((c = @text.slice!(/./m)) != nil)
# \\ 的情況下
if c == "\000"
# 還原為本來的文字
c = "\\"
end
# \C[n] 的情況下
if c == "\001"
# 取得字色編碼
@text.sub!(/\[([0-9#a-zA-Z]+)\]/,"")
# 如果是設定RGB顏色
if $1[0,1]=="#"
# 先拷貝一下文字
c=$1.dup
# 分3段分別取出R,G,B顏色
c.sub!(/#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})/,"")
# 設定文字顏色
self.contents.font.color = Color.new($1.to_i(16),$2.to_i(16),$3.to_i(16),@op)
next
else
# 記錄到變量 color
color = $1.to_i
# 字色0~7是有效的
if color >= 0 and color <= 7
# 設置文字顏色
self.contents.font.color = text_color(color)
end
end
# 進行下次循環
next
end
# 顯示金錢窗口,這個……不用說了吧……
if c == "\002"
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
next
end
# 另起一行文字的情況下
if c == "\n"
# 刷新選擇項及光標的高
if @y >= $game_temp.choice_start
@cursor_width = [@cursor_width,@x>440 ? 448 : @x+8].max
end
# y 加 1
@y += 1
# 因為字體大小會變化,這裡添加判斷語句,超出就不顯示了
if @y>=self.contents.height/@height
# 刪除@text剩餘的所有內容
@text=nil
# 然後返回
break
end
# 因為頭像的緣故,這裡需要改寫
if @right
# 頭像右邊顯示的時候是0
@x=0
else
# 頭像靠左顯示時@x要留出繪製頭像空間
@x=104
end
# 移動到選擇項的下一行
if @y >= $game_temp.choice_start
@x=16
end
# 下面的文字
next
end
# 等待n畫格
if c == "\024"
# 取得參數(需要等待多少畫格)
@text.sub!(/\[([0-9]+)\]/,"")
# 設定@delay標誌
@delay = $1.to_i
# 退出此次循環
break
end
# 顯示頭像
if c == "\030"
#暫時記錄文字大小,用於顯示完頭像恢復
size=self.contents.font.size
# 設定為正常的20號字
self.contents.font.size=20
# 設定系統字色,為寫名字做準備的
self.contents.font.color = system_color
# 取得"[]"內的字符並從原字串中刪除這一部分
@text.sub!(/\[([0-9]+)\]/,"")
# 記錄到head變量
head=$1
# 判斷頭像和原來的是不是一樣的
if @face == nil
# 不一樣
if @head_file != head
# 改變成現在的頭像檔案名
@head_file = head
# 不一樣的話再重新載入頭像
@head_bmp=RPG::Cache.character("head/gpra_"+@head_file,0)
end
else
# 當表情不是空的時候需要考慮表情的
if @head_file != head + "_" + @face
# 改變成現在的頭像檔案名
@head_file = head + "_" + @face
# 不一樣的話再重新載入頭像
@head_bmp=RPG::Cache.character("head/gpra_"+@head_file,0)
end
end
# 顯示頭像,分左右兩種情況
if @right
# 繪製頭像圖片
self.contents.blt(348,0,@head_bmp,Rect.new(0,0,100,100))
# 顯示角色姓名
if @name==nil
# 取得角色姓名到變量 c
c = $game_actors[head.to_i].name
# 描繪角色的姓名
self.contents.draw_text(348,104,100,24,c,1)
else
# 取得"???"到變量 c,當然這個"???"可以改為其他的預設值
c = @name
# 描繪角色的姓名
self.contents.draw_text(348,104,100,24,c,1)
end
else
# 繪製頭像圖片
self.contents.blt(0,0,@head_bmp,Rect.new(0,0,100,100))
# 顯示角色姓名
if @name==nil
# 取得角色姓名到變量 c
c = $game_actors[head.to_i].name
# 描繪角色的姓名
self.contents.draw_text(0,104,100,24,c,1)
else
# 取得"???"到變量 c,當然這個"???"可以改為其他的預設值
c = @name
# 描繪角色的姓名
self.contents.draw_text(0,104,100,24,c,1)
end
end
# 恢復預設字色
self.contents.font.color = normal_color
# 恢復字體大小
self.contents.font.size=size
# 進行下一次循環
next
end
# 描繪文字
self.contents.draw_text(4+@x,@height*@y,@height,@height,c)
# x 為描繪文字寬度進行自增運算,計算下一個文字起始位置
@x += self.contents.text_size(c).width
# 操作了@type_mode個字符後就退出循環了,@type_mode為負則操作一次完成
i-=1
if i==0
break
end
end
end
# 如果@text處理結束了,就設置結束標誌
if @text==nil or @text==""
@finish=true
end
end
#==============================================================================
# ■ Window_Frame (樺だけで中身の無いウィンドウ)
#==============================================================================
class Window_Frame < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x,y,width,height)
super(x,y,width,height)
self.contents = nil
self.back_opacity =200
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
super
end
end
#==============================================================================
# ■ Air_Text (何も無いところに文字描寫 = 樺の無い瞬間表示メッセージウィンドウ)
#==============================================================================
class Air_Text < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x,y,designate_text)
super(x-16,y-16,32 + designate_text.size * 12,56)
self.opacity = 0
self.back_opacity = 0
self.contents = Bitmap.new(self.width - 32,self.height - 32)
w = self.contents.width
h = self.contents.height
self.contents.draw_text(0,0,w,h,designate_text)
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
self.contents.clear
super
end
end
end
复制代码
[LINE]1,#dddddd[/LINE]
本贴由论坛斑竹叶舞枫结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^
作者:
aaasss955
时间:
2007-6-17 02:27
标题:
谁能帮我简单化对话框加强脚本
\n[1]:显示1号角色的姓名
\m[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
\m[\n[1]]:显示一号人物名子的方框
我只要这几种功能就好,其他不要
#==============================================================================
# ◎ GPRA_Window_Message
#------------------------------------------------------------------------------
# ◎ 顯示文章的信息窗口加強。
#------------------------------------------------------------------------------
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化狀態
#--------------------------------------------------------------------------
def initialize
# super(60,304,520,160)
super(135,304,500,160)
self.contents = Bitmap.new(width - 32,height - 32)
self.visible = false
self.z = 9998
@fade_in = false
@fade_out = false
@contents_showing = false
@cursor_width = 0
@op = 255 # 不透明度
@head_bmp = nil # 裝載頭像用
@head_file = nil # 頭像檔案名
@text = nil # 記錄所處理文字
@skip = false # 記錄是否跳過此次對話
@auto_close = -1 # 預設不打開自動關閉
@type_mode=-1 # 打字模式
@delay=-1 # 等待n畫格標誌
@finish=false # 記錄文字處理是否結束
@is_read_txt =false # 預設不是在讀取txt檔案
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● 釋放
#--------------------------------------------------------------------------
def dispose
terminate_message
$game_temp.message_window_showing = false
if @input_number_window != nil
@input_number_window.dispose
end
super
end
#--------------------------------------------------------------------------
# ● 處理信息結束
#--------------------------------------------------------------------------
def terminate_message
#以下為增加姓名框處理
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
#以上為增加姓名框處理
self.active = false
self.pause = false
self.index = -1
self.contents.clear
# 清除顯示中標誌
@contents_showing = false
# 呼叫信息調用
if $game_temp.message_proc != nil
$game_temp.message_proc.call
end
# 清除文章,選擇項,輸入數值的相關變量
$game_temp.message_text = nil
$game_temp.message_proc = nil
$game_temp.choice_start = 99
$game_temp.choice_max = 0
$game_temp.choice_cancel_type = 0
$game_temp.choice_proc = nil
$game_temp.num_input_start = 99
$game_temp.num_input_variable_id = 0
$game_temp.num_input_digits_max = 0
# 開放金錢窗口
if @gold_window != nil
@gold_window.dispose
@gold_window = nil
end
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
# 清空原先內容
self.contents.clear
# 恢復一般字色
self.contents.font.color = normal_color
# 恢復字體大小
self.contents.font.size = 20
# 繪製文字位置初始化
@x = @y = 0
# 字體高度記錄
@height = 32
# 文字不透明度設定為255
@op = 255
# 頭像預設顯示在右邊
@right = true
# 頭像預設顯示一般表情
@face = nil
# 預設顯示角色姓名
@name = nil
# 預設不跳過此次對話
@skip = false
# 從變量讀取自動關閉設置
@auto_close = $game_variables[102]
# 從變量讀取打字模式設置
@type_mode=$game_variables[103]
# 預設不等待
@delay=-1
# 設定文字沒有處理結束
@finish=false
# 光標寬度初始化為零
@cursor_width = 0
# 到選擇項的下一行字
if $game_temp.choice_start == 0
@x = 16
end
# 有等待顯示的文字的情況下
# (註:因為一旦文字非空就處理,所以可以設定 $game_temp.message_text 達到顯示文章的效果)
if $game_temp.message_text != nil
# # @text 功能改進
# if @text==nil or @text==""
# @text = $game_temp.message_text.dup
# else
# @text = @text + $game_temp.message_text
# end
#以下為對話記錄
clue = $game_temp.message_text.split(/@clu/)[1]
if clue != nil
if @text==nil
@text = $game_temp.message_text.split(/@/)[0]
else
@text = @text + $game_temp.message_text.split(/@/)[0]
end
# @text = $game_temp.message_text.split(/@/)[0]
if $game_variables[36].include?($game_variables[3])==false
$game_variables[36][$game_variables[3]]={}
end#當前魔塔編號不存在就創建它
if $game_variables[36][$game_variables[3]].include?($game_variables[2])==false
$game_variables[36][$game_variables[3]][$game_variables[2]]=[]
end#當前魔塔編號當前樓層不存在就創建它
if $game_variables[36][0].include?($game_variables[3])==false
$game_variables[36][0][$game_variables[3]]=0
end#當前魔塔編號對話記錄次數不存在就創建它
if $game_variables[36][$game_variables[3]][1000]==nil
$game_variables[36][$game_variables[3]][1000]=[]
end#當前魔塔編號對話記錄順序排列不存在就創建它
# p $game_temp.message_text.split(/@/)[0]
# p $game_variables[36][$game_variables[3]][$game_variables[2]].include?($game_temp.message_text.split(/@/)[0])
if $game_variables[36][$game_variables[3]][$game_variables[2]].include?($game_temp.message_text.split(/@/)[0])==false
$game_variables[36][$game_variables[3]][$game_variables[2]].push ($game_temp.message_text.split(/@/)[0])
$game_variables[36][0][$game_variables[3]]+=1# 已知的對話條數
@j=0
for i in 0...$game_variables[2]+1
if $game_variables[36][$game_variables[3]].include?(i)
@j+=$game_variables[36][$game_variables[3]][i].size
end
end
@j-=1
@j=0 if @j<=0
$game_variables[36][$game_variables[3]][1000].insert @j,[$game_variables[2],$game_variables[36][$game_variables[3]][$game_variables[2]][$game_variables[36][$game_variables[3]][$game_variables[2]].size-1]]
end
else
if @text==nil
@text = $game_temp.message_text.dup
else
@text = @text + $game_temp.message_text
end
# @text = $game_temp.message_text
end
#以上為對話記錄
# 最先必須要將 "\\\\" 變換為 "\000"
@text.gsub!(/\\\\/) { "\000" }
# 在TXT模式還沒有打開的時候
if !@is_read_txt
# TXT讀取模式打開
if @text.slice!(/\\[Tt][Xx][Tt]\[(\w+)\]\[(\w+)\]/)!=nil
# 打開檔案,成功打開後再進入後面部分
if @ts.open($1,$2)
# 根據顯示模式確定需要打開行數
case $game_variables[1]
when 0 # 正常模式
@text = @ts.get_text(4)
when 1 # 圖書模式
@text = @ts.get_text(12)
when 2 # 全螢幕模式
@text = @ts.get_text(15)
end
# 如果包含[END]
if @text.gsub!(/\[END\]/){""}!=nil
#退出TXT讀取模式
@is_read_txt=false
else
#否則設置正在讀取標誌
@is_read_txt=true
end
end
else
if @text.slice!(/\\[Tt][Xx][Tt]\[(\w+)\]/)!=nil
# 打開檔案,成功打開後再進入後面部分
if @ts.open($1,"")
# 根據顯示模式確定需要打開行數
case $game_variables[101]
when 0 # 正常模式
@text = @ts.get_text(4)
when 1 # 圖書模式
@text = @ts.get_text(12)
when 2 # 全螢幕模式
@text = @ts.get_text(15)
end
# 如果包含[END]
if @text.gsub!(/\[END\]/){""}!=nil
#退出TXT讀取模式
@is_read_txt=false
else
#否則設置正在讀取標誌
@is_read_txt=true
end
end
end
end
end
# 如果取得的字符含"\\~"時
if @text.slice!(/\\~/)!=nil
# 跳過此次對話
terminate_message
# 設置跳過此次對話標誌
@skip = true
# 直接返回等待連接後面部分
return
end
# 限制文字處理(註:這裡是預設功能。)
begin
last_text = @text.clone
@text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until @text == last_text
@text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
#(註:後面將單個字符循環判斷,所以這裡將控制符全部換成單個字符)
# 為了方便將 "\\C" 變為 "\001"
@text.gsub!(/\\[Cc]\[([0-9#a-zA-Z]+)\]/) { "\001[#{$1}]" }
# "\\G" 變為 "\002"
@text.gsub!(/\\[Gg]/) { "\002" }
# ========================增強功能========================
#對話加強
@now_text=$game_temp.message_text
name_window_set = false#\m[姓名]在對話框上增加姓名
if (/\\[Mm]\[(.+?)\]/.match(@now_text)) != nil
# name_window_set = true
name_text = $1
@now_text.sub!(/\\[Mm]\[(.*?)\]/) { "" }
end
@text.gsub!(/\\[Mm]\[(.+?)\]/) do
name_window_set = true
name_text = $1
@now_text.sub!(/\\[Mm]\[(.*?)\]/) { "" }
end
#對話加強
# "\\/" 刪除行尾換行符號
@text.gsub!(/\\\/\n/) {""}
# 去掉不在行尾的"\\/"符號,防止出錯
@text.gsub!(/\\\//) {""}
# "\\S" 字體大小(只修改第一個"\\S")
# 這裡首先刪掉能找到的第一個"\\S"
if @text.slice!(/\\[Ss]\[([0-9]+)\]/)!=nil
# 當找了"\\S"時滿足上述條件,就設置文字大小
self.set_font_size($1.to_i)
end
# "\\O" 文字透明度(使用注意同上,模擬聲音變小……)
if @text.slice!(/\\[Oo]\[([0-9]+)\]/)!=nil
self.set_font_op($1.to_i)
end
# "\\=" 停頓固定畫格(延時)
@text.gsub!(/\\=\[([0-9]+)\]/) { "\024[#{$1}]" }
# "\\." 停頓3畫格
@text.gsub!(/\\\./) { "\024[3]" }
# "\\_" 停頓1秒(30畫格)
@text.gsub!(/\\_/) { "\024[30]" }
# "\\L" 指定頭像左邊顯示
if @text.slice!(/\\[Ll]/)!=nil
# 設定頭像居右標誌為假
@right=false
# 順便要設置@x=104,文字在右邊顯示
@x=104
end
# "\\X" 指定不要顯示姓名,帶參數就是指定顯示姓名(可內部使用"\\N[]")
# 首先是尋找有沒有帶參數的"\\X"
if @text.slice!(/\\[Xx]\[(\w+)\]/)!=nil
# 找到的話將參數賦予@name
@name=$1
# 沒有找到的話
else
# 再去尋找有沒有不帶參數的"\\X"
if @text.slice!(/\\[Xx]/)!=nil
# 找到的話就將姓名變成"???"
@name="???"
end
end
# "\\F" 指定表情(Face 用來指定表情啦)
# 這裡"\w"表示匹配字母+數字還有下劃線,同樣支援中文
if @text.slice!(/\\[Ff]\[(\w+)\]/)!=nil
# 找到的話就設定表情
@face=$1
end
# "\\H" 顯示頭像(不明白大家為什麼都喜歡用 Face 表示頭像……)
# 這裡我將把顯示頭像放到字串的最前面,因為頭像應該先顯示出來
if @text.slice!(/\\[Hh]\[([0-9]+)\]/)!=nil
# 找到的話就提到字符串最前面
@text="\030[#{$1}]"+@text
end
# ================ 分析部分結束,下面是顯示部分 ================
# 在此調用過程完成,因為在update部分也會有相同代碼
self.refresh_
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
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
#對話加強
# reset_window
if name_window_set
off_x = 0
off_y = -40
space = 2
x = self.x + off_x - space / 2
y = self.y + off_y - space / 2
w = self.contents.text_size(name_text).width + 26 + space
h = 40 + space
@name_window_frame = Window_Frame.new(x,y,w,h)
@name_window_frame.z = self.z + 1
x = self.x + off_x + 4
y = self.y + off_y
@name_window_text = Air_Text.new(x+4,y+6,name_text)
@name_window_text.z = self.z + 2
end
#對話加強
end
#--------------------------------------------------------------------------
# ● 設置窗口位置與不透明度
#--------------------------------------------------------------------------
def reset_window
# 判斷現在的顯示模式
case $game_variables[101]
when 0 # 普通模式
self.width=480
self.height=160
self.contents = Bitmap.new(width - 32,height - 32)
# self.x = 80
self.x = 145
if $game_temp.in_battle
# self.y = 16
self.y = 50
else
case $game_system.message_position
when 0 # 上
# self.y = 16
self.y = 50
when 1 # 中
self.y = 160
when 2 # 下
self.y = 304
end
end
when 1 # 圖書模式
self.width=532
self.height=416
self.contents = Bitmap.new(width - 32,height - 32)
self.x = 54
self.y = 32
when 2 # 全螢幕模式
self.width=672
self.height=512
self.contents = Bitmap.new(width - 32,height - 32)
self.x = -16
self.y = -16
end
if $game_system.message_frame == 0
self.opacity = 255
else
self.opacity = 0
end
self.back_opacity = 192
end
#--------------------------------------------------------------------------
# ● 刷新畫面
#--------------------------------------------------------------------------
def update
super
# 漸變的情況下
if @fade_in
# 腳本在這裡設定透明度
self.contents_opacity += @op/8
if @input_number_window != nil
@input_number_window.contents_opacity += 32
end
if self.contents_opacity >= @op
@fade_in = false
end
return
end
# 輸入數值的情況下
if @input_number_window != nil
@input_number_window.update
#取消-使輸入框可以被取消
if Input.trigger?(Input::B)
$game_switches[44]=true
$game_system.se_play($data_system.cancel_se)
@input_number_window.dispose
@input_number_window = nil
terminate_message
end#以上為增加的功能
# 確定
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
# 刷新文本
self.refresh_
# 如果不是在顯示選擇項中就顯示暫停標誌
if $game_temp.choice_max == 0
self.pause = true
end
# 取消
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
end
end
# @auto_close自減計數
@auto_close-=1
# 確定或者自動關閉
if Input.trigger?(Input::C) or @auto_close==0 # @auto_close為0自動關閉,所以一開始為負數或0就不會自動關閉
# 文字還沒有處理完的時候
if !@finish
# 刪除所有停頓效果
@text.gsub!(/\024\[([0-9]+)\]/) { "" }
# 刪除當前延遲效果
@delay = 0
# 關閉打字效果
@type_mode=-1
# 一次處理完所有的字
self.refresh_
else
# 有選擇項的情況
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
# 清空文字
terminate_message
# 在讀取TXT的模式下,需要繼續打開文字
if @is_read_txt
# 根據顯示模式確定需要打開行數
case $game_variables[101]
when 0 # 正常模式
$game_temp.message_text = @ts.get_text(4)
when 1 # 圖書模式
$game_temp.message_text = @ts.get_text(12)
when 2 # 全螢幕模式
$game_temp.message_text = @ts.get_text(15)
end
# 如果包含[END]則退出TXT讀取模式
if $game_temp.message_text.gsub!(/\[END\]/){""}!=nil
@is_read_txt=false
end
end
end
end
return
end
# 在漸變以外的狀態下有等待顯示的信息與選擇項的場合
if @fade_out == false and !($game_temp.message_text == nil or $game_temp.message_text == "")
@contents_showing = true
$game_temp.message_window_showing = true
reset_window
refresh
Graphics.frame_reset
# 當不跳過對話時才進行淡入操作
if !@skip
self.visible = true
self.contents_opacity = 0
if @input_number_window != nil
@input_number_window.contents_opacity = 0
end
@fade_in = true
end
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 update_cursor_rect
if @index >= 0
n = $game_temp.choice_start + @index
self.cursor_rect.set(8,n * 32,@cursor_width,32)
else
self.cursor_rect.empty
end
end
#--------------------------------------------------------------------------
# ● 設定字體大小
#--------------------------------------------------------------------------
def set_font_size(size=20)
# 最大字96號,再大就超過文字欄了,而且Ruby本來有限制……
if size>96
size=96
end
# 設定字的大小
self.contents.font.size = size
# 如果字太大了就要加高每行文字高度。
if size > 28
@height=size+4
else
@height=32
end
end
#--------------------------------------------------------------------------
# ● 設定文字透明
#--------------------------------------------------------------------------
def set_font_op(op=255)
# 限制透明度為0-255
if op>255
op=255
elsif op<0
op=0
end
# 這裡設定文字透明是沒有用的,設定透明在update過程開始
@op = op
end
#--------------------------------------------------------------------------
# ● 顯示文字/頭像過程
#--------------------------------------------------------------------------
def refresh_
# 處理已經結束的情況下直接return
if @finish
return
end
# 延時處理
@delay-=1
if @delay<=0
# 每次處理i個標誌,這裡i就設置為@type_mode了
i=@type_mode
# c 獲取 1 個字 (如果不能取得文字就循環)
while ((c = @text.slice!(/./m)) != nil)
# \\ 的情況下
if c == "\000"
# 還原為本來的文字
c = "\\"
end
# \C[n] 的情況下
if c == "\001"
# 取得字色編碼
@text.sub!(/\[([0-9#a-zA-Z]+)\]/,"")
# 如果是設定RGB顏色
if $1[0,1]=="#"
# 先拷貝一下文字
c=$1.dup
# 分3段分別取出R,G,B顏色
c.sub!(/#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})/,"")
# 設定文字顏色
self.contents.font.color = Color.new($1.to_i(16),$2.to_i(16),$3.to_i(16),@op)
next
else
# 記錄到變量 color
color = $1.to_i
# 字色0~7是有效的
if color >= 0 and color <= 7
# 設置文字顏色
self.contents.font.color = text_color(color)
end
end
# 進行下次循環
next
end
# 顯示金錢窗口,這個……不用說了吧……
if c == "\002"
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
next
end
# 另起一行文字的情況下
if c == "\n"
# 刷新選擇項及光標的高
if @y >= $game_temp.choice_start
@cursor_width = [@cursor_width,@x>440 ? 448 : @x+8].max
end
# y 加 1
@y += 1
# 因為字體大小會變化,這裡添加判斷語句,超出就不顯示了
if @y>=self.contents.height/@height
# 刪除@text剩餘的所有內容
@text=nil
# 然後返回
break
end
# 因為頭像的緣故,這裡需要改寫
if @right
# 頭像右邊顯示的時候是0
@x=0
else
# 頭像靠左顯示時@x要留出繪製頭像空間
@x=104
end
# 移動到選擇項的下一行
if @y >= $game_temp.choice_start
@x=16
end
# 下面的文字
next
end
# 等待n畫格
if c == "\024"
# 取得參數(需要等待多少畫格)
@text.sub!(/\[([0-9]+)\]/,"")
# 設定@delay標誌
@delay = $1.to_i
# 退出此次循環
break
end
# 顯示頭像
if c == "\030"
#暫時記錄文字大小,用於顯示完頭像恢復
size=self.contents.font.size
# 設定為正常的20號字
self.contents.font.size=20
# 設定系統字色,為寫名字做準備的
self.contents.font.color = system_color
# 取得"[]"內的字符並從原字串中刪除這一部分
@text.sub!(/\[([0-9]+)\]/,"")
# 記錄到head變量
head=$1
# 判斷頭像和原來的是不是一樣的
if @face == nil
# 不一樣
if @head_file != head
# 改變成現在的頭像檔案名
@head_file = head
# 不一樣的話再重新載入頭像
@head_bmp=RPG::Cache.character("head/gpra_"+@head_file,0)
end
else
# 當表情不是空的時候需要考慮表情的
if @head_file != head + "_" + @face
# 改變成現在的頭像檔案名
@head_file = head + "_" + @face
# 不一樣的話再重新載入頭像
@head_bmp=RPG::Cache.character("head/gpra_"+@head_file,0)
end
end
# 顯示頭像,分左右兩種情況
if @right
# 繪製頭像圖片
self.contents.blt(348,0,@head_bmp,Rect.new(0,0,100,100))
# 顯示角色姓名
if @name==nil
# 取得角色姓名到變量 c
c = $game_actors[head.to_i].name
# 描繪角色的姓名
self.contents.draw_text(348,104,100,24,c,1)
else
# 取得"???"到變量 c,當然這個"???"可以改為其他的預設值
c = @name
# 描繪角色的姓名
self.contents.draw_text(348,104,100,24,c,1)
end
else
# 繪製頭像圖片
self.contents.blt(0,0,@head_bmp,Rect.new(0,0,100,100))
# 顯示角色姓名
if @name==nil
# 取得角色姓名到變量 c
c = $game_actors[head.to_i].name
# 描繪角色的姓名
self.contents.draw_text(0,104,100,24,c,1)
else
# 取得"???"到變量 c,當然這個"???"可以改為其他的預設值
c = @name
# 描繪角色的姓名
self.contents.draw_text(0,104,100,24,c,1)
end
end
# 恢復預設字色
self.contents.font.color = normal_color
# 恢復字體大小
self.contents.font.size=size
# 進行下一次循環
next
end
# 描繪文字
self.contents.draw_text(4+@x,@height*@y,@height,@height,c)
# x 為描繪文字寬度進行自增運算,計算下一個文字起始位置
@x += self.contents.text_size(c).width
# 操作了@type_mode個字符後就退出循環了,@type_mode為負則操作一次完成
i-=1
if i==0
break
end
end
end
# 如果@text處理結束了,就設置結束標誌
if @text==nil or @text==""
@finish=true
end
end
#==============================================================================
# ■ Window_Frame (樺だけで中身の無いウィンドウ)
#==============================================================================
class Window_Frame < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x,y,width,height)
super(x,y,width,height)
self.contents = nil
self.back_opacity =200
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
super
end
end
#==============================================================================
# ■ Air_Text (何も無いところに文字描寫 = 樺の無い瞬間表示メッセージウィンドウ)
#==============================================================================
class Air_Text < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x,y,designate_text)
super(x-16,y-16,32 + designate_text.size * 12,56)
self.opacity = 0
self.back_opacity = 0
self.contents = Bitmap.new(self.width - 32,self.height - 32)
w = self.contents.width
h = self.contents.height
self.contents.draw_text(0,0,w,h,designate_text)
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
self.contents.clear
super
end
end
end
复制代码
[LINE]1,#dddddd[/LINE]
本贴由论坛斑竹叶舞枫结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^
作者:
叶舞枫
时间:
2007-6-18 22:17
那你就用那3个功能就行了,其他别用,反正米影响。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1