Project1

标题: 关于战斗图像 [打印本页]

作者: 766rsr    时间: 2016-5-29 18:25
标题: 关于战斗图像
本帖最后由 766rsr 于 2016-5-29 19:19 编辑


不小心按到已解决

因为我将战斗人数扩充到了6个人
所以在显示战斗图像时 因为图片固定了 在选第5跟第6人时 图片固定在左上结果被切了 有人可以帮忙吗?



#encoding:utf-8
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  战斗画面中,显示“队伍成员状态”的窗口。
#==============================================================================

class Window_BattleStatus
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  alias super_refresh refresh
  def refresh
    @DreamST = 0
    @DreamST = 1 if @index >= 0
    super_refresh
    draw_face_emiya(@index) if @index >= 0
  end
  #--------------------------------------------------------------------------
  # ● 绘制人物头像
  #--------------------------------------------------------------------------
  def draw_face_emiya(index)
    rect = Rect.new(0, 0, 96, 96)
    self.contents.clear_rect(rect)
    actor = $game_party.battle_members[index]
    draw_actor_face(actor, 0, 0, true)
  end

  #--------------------------------------------------------------------------
  # ● 繪制基本區域
  #--------------------------------------------------------------------------
  def draw_basic_area(rect, actor)      #DreamYeh: 當選擇人時候隱藏名字 顯示狀態
    if @DreamST == 0
      draw_actor_name(actor, rect.x + 0, rect.y, 100)
      draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
    else
      draw_actor_icons(actor, rect.x , rect.y, rect.width - 104)
    end
   
  end
  
  #--------------------------------------------------------------------------
  # ● 获取项目的绘制矩形
  #--------------------------------------------------------------------------
  alias super_item_rect item_rect
  def item_rect(index)
    rect = super_item_rect(index)
    if @index >= 0
      rect.width - 100;
      rect.x += 100
    end
    return rect
  end
  
  #--------------------------------------------------------------------------
  # ● 获取值槽区域的矩形
  #--------------------------------------------------------------------------
  alias super_gauge_area_rect gauge_area_rect
  def gauge_area_rect(index)
    rect = super_gauge_area_rect(index)
    rect.x -= 100 if @index >= 0
    return rect
  end
  #--------------------------------------------------------------------------
  # ● 更新光标
  #--------------------------------------------------------------------------
  alias super_update_cursor update_cursor
  def update_cursor
    super_update_cursor
    refresh
  end
end

未命名.PNG (326.5 KB, 下载次数: 21)

未命名.PNG

未命名1.PNG (334.6 KB, 下载次数: 23)

未命名1.PNG

作者: 766rsr    时间: 2016-5-29 19:21
抱歉 第一次發文

作者: 766rsr    时间: 2016-5-29 19:27
标题: 关于战斗图像
因为我将战斗人数扩充到了6个人
所以在显示战斗图像时 因为图片固定了 在选第5跟第6人时 图片固定在左上结果被切了 有人可以帮忙吗?



#encoding:utf-8
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  战斗画面中,显示“队伍成员状态”的窗口。
#==============================================================================

class Window_BattleStatus
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  alias super_refresh refresh
  def refresh
    @DreamST = 0
    @DreamST = 1 if @index >= 0
    super_refresh
    draw_face_emiya(@index) if @index >= 0
  end
  #--------------------------------------------------------------------------
  # ● 绘制人物头像
  #--------------------------------------------------------------------------
  def draw_face_emiya(index)
    rect = Rect.new(0, 0, 96, 96)
    self.contents.clear_rect(rect)
    actor = $game_party.battle_members[index]
    draw_actor_face(actor, 0, 0, true)
  end

  #--------------------------------------------------------------------------
  # ● 繪制基本區域
  #--------------------------------------------------------------------------
  def draw_basic_area(rect, actor)      #DreamYeh: 當選擇人時候隱藏名字 顯示狀態
    if @DreamST == 0
      draw_actor_name(actor, rect.x + 0, rect.y, 100)
      draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
    else
      draw_actor_icons(actor, rect.x , rect.y, rect.width - 104)
    end
   
  end
  
  #--------------------------------------------------------------------------
  # ● 获取项目的绘制矩形
  #--------------------------------------------------------------------------
  alias super_item_rect item_rect
  def item_rect(index)
    rect = super_item_rect(index)
    if @index >= 0
      rect.width - 100;
      rect.x += 100
    end
    return rect
  end
  
  #--------------------------------------------------------------------------
  # ● 获取值槽区域的矩形
  #--------------------------------------------------------------------------
  alias super_gauge_area_rect gauge_area_rect
  def gauge_area_rect(index)
    rect = super_gauge_area_rect(index)
    rect.x -= 100 if @index >= 0
    return rect
  end
  #--------------------------------------------------------------------------
  # ● 更新光标
  #--------------------------------------------------------------------------
  alias super_update_cursor update_cursor
  def update_cursor
    super_update_cursor
    refresh
  end
end

未命名.PNG (326.5 KB, 下载次数: 21)

未命名.PNG

未命名1.PNG (334.6 KB, 下载次数: 19)

未命名1.PNG

作者: cinderelmini    时间: 2016-5-30 14:59
  1.   #--------------------------------------------------------------------------
  2.   # ● 绘制人物头像
  3.   #--------------------------------------------------------------------------
  4.   def draw_face_emiya(index)
  5.     rect = Rect.new(0, 0, 96, 96)
  6.     self.contents.clear_rect(rect)
  7.     actor = $game_party.battle_members[index]
  8.     draw_actor_face(actor, 0, 0 + self.oy, true)
  9.   end
复制代码
这段改成这样试试看~




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