Project1

标题: 商店 [打印本页]

作者: 1064593631    时间: 2014-5-5 19:12
标题: 商店
商店钱不够  能否不让物品字体变暗

2014-05-05_191339.png (12.22 KB, 下载次数: 7)

2014-05-05_191339.png

作者: 芯☆淡茹水    时间: 2014-5-5 21:07
这个 :
  1. #==============================================================================
  2. class Window_ShopBuy < Window_Selectable
  3.   #--------------------------------------------------------------------------
  4.   def draw_item(index)
  5.     item = @data[index]
  6.     # 获取物品所持数
  7.     case item
  8.     when RPG::Item
  9.       number = $game_party.item_number(item.id)
  10.     when RPG::Weapon
  11.       number = $game_party.weapon_number(item.id)
  12.     when RPG::Armor
  13.       number = $game_party.armor_number(item.id)
  14.     end
  15.     # 价格在所持金以下、并且所持数不是 99 的情况下为普通文字颜色
  16.     # 除此之外的情况设置为无效文字色
  17.     if number < 99
  18.       self.contents.font.color = normal_color
  19.     else
  20.       self.contents.font.color = disabled_color
  21.     end
  22.     x = 4
  23.     y = index * 32
  24.     rect = Rect.new(x, y, self.width - 32, 32)
  25.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  26.     bitmap = RPG::Cache.icon(item.icon_name)
  27.     opacity = self.contents.font.color == normal_color ? 255 : 128
  28.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  29.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  30.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  31.   end
  32. end
  33. #==============================================================================
复制代码

作者: 1064593631    时间: 2014-5-6 12:20
谢谢了-_-
作者: 1064593631    时间: 2014-5-6 12:22
芯☆淡茹水 发表于 2014-5-5 21:07
这个 :

谢谢了-_-




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