赞 | 4 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 640
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023

|
- class RPG::BaseItem
- def word_color
- self.note.split(/[\r\n]+/).each { |line|
- if line =~ /\[word color H (\d+), (\d+), (\d+)\]/i
- return Color.new($1.to_i, $2.to_i, $3.to_i)
- elsif line =~ /\[wordcolor (\d+)\]/i
- x = 64 + ($1.to_i % 8) * 8
- y = 96 + ($1.to_i / 8) * 8
- return Cache.system("Window").get_pixel(x, y)
- end}
- return Color.new(255, 255, 255)
- end
- end
- class Window_Base < Window
- def draw_item_name(item, x, y, enabled = true)
- if item != nil
- draw_icon(item.icon_index, x, y, enabled)
- self.contents.font.color = item.word_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x + 24, y, 172, WLH, item.name)
- end
- end
- end
复制代码
使用方法:
在备注栏里面写
[word color 颜色ID]
或
[word color H R, G, B]
|
|