Project1

标题: BattleStatus窗口的矩形描绘问题 [打印本页]

作者: saturnfjh    时间: 2012-1-21 10:59
标题: BattleStatus窗口的矩形描绘问题
昨天心血来潮把战斗人数增加到了5个,然后重调了一下BattleStatus的显示,如图:



注意下面有个小三角形~~说明显示不完全~~

轮到5号角色选择指令时会变成这样:



这是什么巫术?

然后我试了一下,将BattleStatus的显示行数调至5以上时就不会有这种情况,一切正常,但是行数4就会悲剧...求指教...

附上BattleStatus的代码:
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_BattleStatus
  4. #------------------------------------------------------------------------------
  5. #  战斗画面中,显示“队伍成员状态”的窗口。
  6. #==============================================================================

  7. class Window_BattleStatus < Window_Selectable
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对象
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     super(0, 0, window_width, window_height)
  13.     refresh
  14.     self.openness = 0
  15.     self.opacity = 255
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 获取窗口的宽度
  19.   #--------------------------------------------------------------------------
  20.   def window_width
  21.     Graphics.width
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 获取窗口的高度
  25.   #--------------------------------------------------------------------------
  26.   def window_height
  27.     fitting_height(visible_line_number)
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 获取显示行数
  31.   #--------------------------------------------------------------------------
  32.   def visible_line_number
  33.     return 4
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 获取项目数
  37.   #--------------------------------------------------------------------------
  38.   def item_max
  39.     $game_party.battle_members.size
  40.   end
  41.   
  42.   #--------------------------------------------------------------------------
  43.   # ● 刷新
  44.   #--------------------------------------------------------------------------
  45.   def refresh
  46.     contents.clear
  47.     draw_all_items
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 绘制项目
  51.   #--------------------------------------------------------------------------
  52.   def draw_item(index)
  53.     actor = $game_party.battle_members[index]
  54.     draw_basic_area(basic_area_rect(index), actor)
  55.     draw_gauge_area(gauge_area_rect(index), actor)
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 获取基本区域的矩形
  59.   #--------------------------------------------------------------------------
  60.   def basic_area_rect(index)
  61.     rect = item_rect_for_text(index)
  62.     rect.x = index * 100 + 6
  63.     rect.y = 0
  64.     rect.height = 96
  65.     rect.width = 102
  66.     rect
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 获取值槽区域的矩形
  70.   #--------------------------------------------------------------------------
  71.   def gauge_area_rect(index)
  72.     rect = item_rect_for_text(index)
  73.     rect.x = index * 102 + 6
  74.     rect.y = 0
  75.     rect.width = 102
  76.     rect
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 获取值槽区域的宽度
  80.   #--------------------------------------------------------------------------
  81.   def gauge_area_width
  82.     return 88
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 绘制基本区域
  86.   #--------------------------------------------------------------------------
  87.   def draw_basic_area(rect, actor)
  88.     draw_actor_name_bs(actor, rect.x + 2, rect.y, 102)
  89.     draw_actor_icons(actor, rect.x + 4, rect.y + 24, 96)
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● 绘制值槽区域
  93.   #--------------------------------------------------------------------------
  94.   def draw_gauge_area(rect, actor)
  95.     if $data_system.opt_display_tp
  96.       draw_gauge_area_with_tp(rect, actor)
  97.     else
  98.       draw_gauge_area_without_tp(rect, actor)
  99.     end
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 绘制值槽区域(包括 TP)
  103.   #--------------------------------------------------------------------------
  104.   def draw_gauge_area_with_tp(rect, actor)
  105.     draw_actor_hp(actor, rect.x + 2, rect.y + 24, 88)
  106.     draw_actor_mp(actor, rect.x + 2, rect.y + 48, 88)
  107.     draw_actor_tp(actor, rect.x + 2, rect.y + 72, 88)
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 绘制值槽区域(不包括 TP)
  111.   #--------------------------------------------------------------------------
  112.   def draw_gauge_area_without_tp(rect, actor)
  113.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  114.     draw_actor_mp(actor, rect.x + 144,  rect.y, 80)
  115.   end
  116.     #--------------------------------------------------------------------------
  117.   # ● 項目を描画する矩形の取得
  118.   #--------------------------------------------------------------------------
  119.   def item_rect(index)
  120.     rect = Rect.new
  121.     rect.width = 102
  122.     rect.height = 96
  123.     rect.x = index * 103 + 2
  124.     rect.y = 0
  125.     rect
  126.   end
  127. end
复制代码

作者: wbsy8241    时间: 2012-1-21 11:13
  1.   #--------------------------------------------------------------------------
  2.   # ● 取得列数
  3.   #--------------------------------------------------------------------------
  4.   def col_max
  5.     return 5
  6.   end
  7.   #--------------------------------------------------------------------------
  8.   # ● 取得显示行数
  9.   #--------------------------------------------------------------------------
  10.   def visible_line_number
  11.     return 1
  12.   end
复制代码





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