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

Project1

 找回密码
 注册会员
搜索
查看: 4120|回复: 0

[已经过期] 如何在战斗状态内追加跟随窗口移动的装饰图片?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
166 小时
注册时间
2011-4-3
帖子
61
发表于 2012-1-25 10:15:36 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 first-fantasy 于 2012-1-25 20:29 编辑

jt5.PNG
我想在那战斗状态窗口追加跟随窗口移动的装饰图片,问题老是失败,问了皮卡都解决不了。
如何在战斗状态内追加跟随窗口移动的装饰图片?
battlestatus 拷贝.png
  1. class Window_BattleStatus < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对象
  4.   #--------------------------------------------------------------------------
  5.   def initialize
  6.     super(0, 0, window_width, window_height)
  7.     self.opacity = 0
  8.     refresh
  9.     self.openness = 0
  10.   end
  11.   #--------------------------------------------------------------------------
  12.   # ● 获取窗口的宽度
  13.   #--------------------------------------------------------------------------
  14.   def window_width
  15.     Graphics.width - 128
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 获取窗口的高度
  19.   #--------------------------------------------------------------------------
  20.   def window_height
  21.     fitting_height(visible_line_number)
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 获取显示行数
  25.   #--------------------------------------------------------------------------
  26.   def visible_line_number
  27.     return 1
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 获取项目数
  31.   #--------------------------------------------------------------------------
  32.   def item_max
  33.     $game_party.battle_members.size
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 刷新
  37.   #--------------------------------------------------------------------------
  38.   def refresh
  39.     contents.clear
  40.     draw_all_items
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● 绘制项目
  44.   #--------------------------------------------------------------------------
  45.   def draw_item(index)
  46.     actor = $game_party.battle_members[index]
  47.     draw_basic_area(basic_area_rect(index), actor)
  48.     draw_gauge_area(gauge_area_rect(index), actor)
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # ● 获取基本区域的矩形
  52.   #--------------------------------------------------------------------------
  53.   def basic_area_rect(index)
  54.     rect = item_rect_for_text(index)
  55.     rect.width -= gauge_area_width + 10
  56.     rect
  57.   end
  58.   #--------------------------------------------------------------------------
  59.   # ● 获取值槽区域的矩形
  60.   #--------------------------------------------------------------------------
  61.   def gauge_area_rect(index)
  62.     rect = item_rect_for_text(index)
  63.     rect.x += rect.width - gauge_area_width
  64.     rect.width = gauge_area_width
  65.     rect
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 获取值槽区域的宽度
  69.   #--------------------------------------------------------------------------
  70.   def gauge_area_width
  71.     return 220
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 绘制基本区域
  75.   #--------------------------------------------------------------------------
  76.   def draw_basic_area(rect, actor)
  77.     draw_actor_name(actor, rect.x + 0, rect.y, 100)
  78.     #draw_status_pic(54, rect.x, rect.y, 64)  改出来的
  79.     draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● 绘制值槽区域
  83.   #--------------------------------------------------------------------------
  84.   def draw_gauge_area(rect, actor)
  85.     if $data_system.opt_display_tp
  86.       draw_gauge_area_with_tp(rect, actor)
  87.     else
  88.       draw_gauge_area_without_tp(rect, actor)
  89.     end
  90.   end
  91.   def draw_status_pic #新的函数
  92.     bitmap = Cache.face("Graphics/System/battlestatus 拷贝")
  93.     rect = Rect.new
  94.     bitmap.dispose
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 绘制值槽区域(包括 TP)
  98.   #--------------------------------------------------------------------------
  99.   def draw_gauge_area_with_tp(rect, actor)
  100.     draw_actor_hp(actor, rect.x + 0, rect.y, 72)
  101.     draw_actor_mp(actor, rect.x + 82, rect.y, 64)
  102.     draw_actor_tp(actor, rect.x + 156, rect.y, 64)
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ● 绘制值槽区域(不包括 TP)
  106.   #--------------------------------------------------------------------------
  107.   def draw_gauge_area_without_tp(rect, actor)
  108.     draw_actor_hp(actor, rect.x + 0, rect.y, 134)
  109.     draw_actor_mp(actor, rect.x + 144,  rect.y, 76)
  110.   end
  111. end
复制代码
this is my space http://rpg.blue/?142655
1号坑=---------)
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-3-29 21:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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