Project1
标题:
如何给物品名字修改颜色
[打印本页]
作者:
Yophs
时间:
2012-7-22 11:17
标题:
如何给物品名字修改颜色
如题,就是物品名字的颜色有很多种的 。
无标题.jpg
(30.68 KB, 下载次数: 20)
下载附件
保存到相册
2012-7-22 11:17 上传
作者:
gametl8r
时间:
2012-7-22 11:33
圖書館裡不是有嗎
是這個吧?
http://rpg.blue/thread-217113-1-1.html
作者:
咚小黑
时间:
2012-7-23 07:57
#==============================================================================
$_PS0 = {} if $_PS0 == nil
$_PS0["Window_Base_Itemcolor"] = 20111227
#==============================================================================
# [PS0] 通用配置模块
#==============================================================================
module PS0
module Window_Base_Itemcolor
Color1 = Color.new(255, 255, 255) # 一般品质的色彩(白,1)
Color2 = Color.new(128, 255, 128) # 平庸品质的色彩(绿,2)
Color3 = Color.new(128, 128, 255) # 精良品质的色彩(蓝,3)
Color4 = Color.new(255, 0, 255) # 卓越品质的色彩(紫,4)
Color5 = Color.new(255, 128, 128) # 神秘品质的色彩(红,5)
Color6 = Color.new(255, 128, 0) # 传说品质的色彩(橙,6)
Color7 = Color.new(255, 255, 128) # 特殊品质的色彩(黄,7)
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
n = item.note
a = n.split{/<(?:Quality|品质)\s*(.+)>/i}
c = a[1].to_i
if c <= 1
color = PS0::Window_Base_Itemcolor::Color1
elsif c == 2
color = PS0::Window_Base_Itemcolor::Color2
elsif c == 3
color = PS0::Window_Base_Itemcolor::Color3
elsif c == 4
color = PS0::Window_Base_Itemcolor::Color4
elsif c == 5
color = PS0::Window_Base_Itemcolor::Color5
elsif c == 6
color = PS0::Window_Base_Itemcolor::Color6
elsif c == 7
color = PS0::Window_Base_Itemcolor::Color7
else
color = Color.new(0, 0, 0, 0)
end
self.contents.fill_rect(x, y, 24, 1, color)
self.contents.fill_rect(x, y, 1, 24, color)
self.contents.fill_rect(x, y+23, 24, 1, color)
self.contents.fill_rect(x+23, y, 1, 24, color)
draw_icon(item.icon_index, x, y, enabled)
change_color(color, enabled)
draw_text(x + 24, y, width, line_height, item.name)
end
end
end
#==============================================================================
# [PS0] End of Script
#==============================================================================
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1