Project1
标题:
物品图标如何支持32*32?
[打印本页]
作者:
574656549
时间:
2011-8-6 21:23
提示:
作者被禁止或删除 内容自动屏蔽
作者:
2578699
时间:
2011-8-6 21:34
本帖最后由 2578699 于 2011-8-6 21:41 编辑
class Window_Item
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 = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y , bitmap, Rect.new(0, 0, 32, 32), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
复制代码
把这个放到Main前面。是引用逸豫的脚本
2578699于2011-8-6 21:42补充以下内容:
刚才手乱打错了,可以认可了吧?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1