| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 4 |
| 经验 | |
| 最后登录 | 2020-6-14 |
| 在线时间 | 55 小时 |
- 梦石
- 0
- 星屑
- 374
- 在线时间
- 55 小时
- 注册时间
- 2013-12-6
- 回帖
- 15
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 柳妹妹 于 2013-12-15 12:45 编辑
[pre lang="ruby" line="1"] #--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = Color.new(64,70,124,255)
else
self.contents.font.color = Color.new(224,96,112,255)
end
x = 4 + index % 3 * (288 + 32)
y = index / 3 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.font.bold = false
self.contents.fill_rect(rect, Color.new(64,70,124,0))
#bitmap = RPG::Cache.icon(item.icon_name)
#self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
opacity = self.contents.font.color == Color.new(224,96,112,255) ? 255 : 128.
#self.contents.font.color = Color.new(64,70,124,255)
self.contents.draw_text(x + 4, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 190, y, 16, 32, "X", 1)
self.contents.draw_text(x + 210, y, 24, 32, number.to_s, 2)
end
[/pre] |
|