赞 | 0 |
VIP | 3 |
好人卡 | 0 |
积分 | 0 |
经验 | 533 |
最后登录 | 2012-2-6 |
在线时间 | 166 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 49
- 在线时间
- 166 小时
- 注册时间
- 2011-4-3
- 帖子
- 61
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 first-fantasy 于 2012-1-25 20:29 编辑
我想在那战斗状态窗口追加跟随窗口移动的装饰图片,问题老是失败,问了皮卡都解决不了。
如何在战斗状态内追加跟随窗口移动的装饰图片?
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, window_height)
- self.opacity = 0
- refresh
- self.openness = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- Graphics.width - 128
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的高度
- #--------------------------------------------------------------------------
- def window_height
- fitting_height(visible_line_number)
- end
- #--------------------------------------------------------------------------
- # ● 获取显示行数
- #--------------------------------------------------------------------------
- def visible_line_number
- return 1
- end
- #--------------------------------------------------------------------------
- # ● 获取项目数
- #--------------------------------------------------------------------------
- def item_max
- $game_party.battle_members.size
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_all_items
- end
- #--------------------------------------------------------------------------
- # ● 绘制项目
- #--------------------------------------------------------------------------
- def draw_item(index)
- actor = $game_party.battle_members[index]
- draw_basic_area(basic_area_rect(index), actor)
- draw_gauge_area(gauge_area_rect(index), actor)
- end
- #--------------------------------------------------------------------------
- # ● 获取基本区域的矩形
- #--------------------------------------------------------------------------
- def basic_area_rect(index)
- rect = item_rect_for_text(index)
- rect.width -= gauge_area_width + 10
- rect
- end
- #--------------------------------------------------------------------------
- # ● 获取值槽区域的矩形
- #--------------------------------------------------------------------------
- def gauge_area_rect(index)
- rect = item_rect_for_text(index)
- rect.x += rect.width - gauge_area_width
- rect.width = gauge_area_width
- rect
- end
- #--------------------------------------------------------------------------
- # ● 获取值槽区域的宽度
- #--------------------------------------------------------------------------
- def gauge_area_width
- return 220
- end
- #--------------------------------------------------------------------------
- # ● 绘制基本区域
- #--------------------------------------------------------------------------
- def draw_basic_area(rect, actor)
- draw_actor_name(actor, rect.x + 0, rect.y, 100)
- #draw_status_pic(54, rect.x, rect.y, 64) 改出来的
- draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
- end
- #--------------------------------------------------------------------------
- # ● 绘制值槽区域
- #--------------------------------------------------------------------------
- def draw_gauge_area(rect, actor)
- if $data_system.opt_display_tp
- draw_gauge_area_with_tp(rect, actor)
- else
- draw_gauge_area_without_tp(rect, actor)
- end
- end
- def draw_status_pic #新的函数
- bitmap = Cache.face("Graphics/System/battlestatus 拷贝")
- rect = Rect.new
- bitmap.dispose
- end
- #--------------------------------------------------------------------------
- # ● 绘制值槽区域(包括 TP)
- #--------------------------------------------------------------------------
- def draw_gauge_area_with_tp(rect, actor)
- draw_actor_hp(actor, rect.x + 0, rect.y, 72)
- draw_actor_mp(actor, rect.x + 82, rect.y, 64)
- draw_actor_tp(actor, rect.x + 156, rect.y, 64)
- end
- #--------------------------------------------------------------------------
- # ● 绘制值槽区域(不包括 TP)
- #--------------------------------------------------------------------------
- def draw_gauge_area_without_tp(rect, actor)
- draw_actor_hp(actor, rect.x + 0, rect.y, 134)
- draw_actor_mp(actor, rect.x + 144, rect.y, 76)
- end
- end
复制代码 |
|