设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3814|回复: 1
打印 上一主题 下一主题

[已经解决] BattleStatus窗口的矩形描绘问题

[复制链接]

Lv2.观梦者

梦石
0
星屑
719
在线时间
684 小时
注册时间
2009-5-29
帖子
461
跳转到指定楼层
1
发表于 2012-1-21 10:59:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
昨天心血来潮把战斗人数增加到了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
复制代码

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1281 小时
注册时间
2006-8-27
帖子
590
2
发表于 2012-1-21 11:13:08 | 只看该作者
  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
复制代码

点评

原来如此~谢过了~  发表于 2012-1-21 11:20

评分

参与人数 1星屑 +200 梦石 +2 收起 理由
仲秋启明 + 200 + 2 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-12 09:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表