Project1

标题: 物品图标如何支持32*32? [打印本页]

作者: 574656549    时间: 2011-8-6 21:23
提示: 作者被禁止或删除 内容自动屏蔽
作者: 2578699    时间: 2011-8-6 21:34
本帖最后由 2578699 于 2011-8-6 21:41 编辑
  1. class Window_Item
  2.   def draw_item(index)
  3.     item = @data[index]
  4.     case item
  5.     when RPG::Item
  6.       number = $game_party.item_number(item.id)
  7.     when RPG::Weapon
  8.       number = $game_party.weapon_number(item.id)
  9.     when RPG::Armor
  10.       number = $game_party.armor_number(item.id)
  11.     end
  12.     if item.is_a?(RPG::Item) and
  13.        $game_party.item_can_use?(item.id)
  14.       self.contents.font.color = normal_color
  15.     else
  16.       self.contents.font.color = disabled_color
  17.     end
  18.     x = 4 + index % 2 * (288 + 32)
  19.     y = index / 2 * 32
  20.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  21.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  22.     bitmap = RPG::Cache.icon(item.icon_name)
  23.     opacity = self.contents.font.color == normal_color ? 255 : 128
  24.     self.contents.blt(x, y , bitmap, Rect.new(0, 0, 32, 32), opacity)
  25.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  26.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  27.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  28.   end
  29. end
复制代码
把这个放到Main前面。是引用逸豫的脚本


2578699于2011-8-6 21:42补充以下内容:
刚才手乱打错了,可以认可了吧?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1