Project1

标题: 物品窗口显示物品问题 [打印本页]

作者: 冰鸷殛霰    时间: 2007-7-30 16:09
标题: 物品窗口显示物品问题
物品窗口显示物品加大.
一行我改成5个
既@column_max = 5
窗体大小为
super(0, 64-64, 180, 416+64)
问题来了...
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     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 = normal_color
    else
      self.contents.font.color = disabled_color
    end
   
    x = 4 + index * 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 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 1, y+5, 24, 32, number.to_s, 2)
  end
这是显示图片和数量的地方,
怎么才能对准
我这是对错了的
光标也要对准哦
作者: 冰鸷殛霰    时间: 2007-7-30 16:09
标题: 物品窗口显示物品问题
物品窗口显示物品加大.
一行我改成5个
既@column_max = 5
窗体大小为
super(0, 64-64, 180, 416+64)
问题来了...
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     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 = normal_color
    else
      self.contents.font.color = disabled_color
    end
   
    x = 4 + index * 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 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 1, y+5, 24, 32, number.to_s, 2)
  end
这是显示图片和数量的地方,
怎么才能对准
我这是对错了的
光标也要对准哦




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