查看: 2585|回复: 6

[已经解决] 求大手帮忙该脚本的窗口位置数据

[复制链接]
梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-1-11
回帖
14
发表于 2013-3-27 14:49:48 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 ilovejel 于 2013-3-27 23:00 编辑

这个脚本我自己调整了下位置,但是越调越乱。。。求大手指导。。。
/////////////////////////////////////////
状态.jpg
希望能调整成这样的
未命名4.jpg
技能出现的位置也不对
未命名2.jpg
一出现状态后打开技能框就会消失了一半


  1. #==============================================================================
  2. # ■ DrawFvPictures : 専用ピクチャ描画モジュール
  3. #==============================================================================
  4. module DrawFvPictures
  5.   #--------------------------------------------------------------------------
  6.   # ● HP/MP/TP/Act文字 の描画
  7.   #--------------------------------------------------------------------------
  8.   def self.draw_bt_text(bitmap, index, x, y)
  9.     b = Cache.system("bt_text")
  10.     hh = b.height / 4
  11.     bitmap.blt(x, y, b, Rect.new(0, index * hh, b.width, hh))
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 数字ピクチャ(1文字) の矩形 [src]
  15.   #--------------------------------------------------------------------------
  16.   def self.num_rect(index=0, type=0)
  17.     b = Cache.system("number")
  18.     ww = b.width / 10
  19.     hh = b.height / 4
  20.     Rect.new(index*ww, type*hh, ww, hh)
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 数字ピクチャ の矩形 [width, height]
  24.   #--------------------------------------------------------------------------
  25.   def self.text_size(num)
  26.     if damage_type(num) == 4
  27.       b = Cache.system(num)
  28.       Rect.new(0, 0, b.width, b.height)
  29.     else
  30.       b = Cache.system("number")
  31.       Rect.new(0, 0, num.to_s.split("").size * (b.width / 10), b.height / 4)
  32.     end
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 数字ピクチャ(1文字) の描画
  36.   #--------------------------------------------------------------------------
  37.   def self.draw_num_picture(bitmap, x, y, height, num, type=0)
  38.     r = num_rect(num, type)
  39.     yy = (height - r.height) / 2
  40.     bitmap.blt(x, y+yy, Cache.system("number"), r)
  41.     r.width
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● 数値ピクチャ の描画
  45.   #--------------------------------------------------------------------------
  46.   def self.draw_nums_picture(bitmap, x, y, width, height, num, type=0, align=2)
  47.     nums = num.to_s.split("").collect { |i| i.to_i }
  48.     case align
  49.     when 1; x += (width - num_rect(0, type).width * nums.size) / 2
  50.     when 2; x +=  width - num_rect(0, type).width * nums.size
  51.     end
  52.     nums.each { |n| x += draw_num_picture(bitmap, x, y, height, n, type) }
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● ダメージ用文字ピクチャ の矩形
  56.   #--------------------------------------------------------------------------
  57.   def self.draw_dmg_text(bitmap, x, y, file)
  58.     b = Cache.system(file)
  59.     bitmap.blt(x, y, b, Rect.new(0,0,b.width,b.height))
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● HP の文字色を取得
  63.   #--------------------------------------------------------------------------
  64.   def self.hp_color_type(actor)
  65.     return 2 if actor.fv_prm.hp.current == 0
  66.     return 1 if actor.fv_prm.hp.current < actor.mhp / 4
  67.     return 0
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● MP の文字色を取得
  71.   #--------------------------------------------------------------------------
  72.   def self.mp_color_type(actor)
  73.     return 2 if actor.fv_prm.mp.current == 0
  74.     return 1 if actor.fv_prm.mp.current < actor.mmp / 4
  75.     return 0
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● TP の文字色を取得
  79.   #--------------------------------------------------------------------------
  80.   def self.tp_color_type(actor)
  81.     return 2 if actor.fv_prm.tp.current == actor.max_tp
  82.     return 0
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● ダメージ種別を取得
  86.   #--------------------------------------------------------------------------
  87.   def self.damage_type(damage, critical=false)
  88.     if damage.is_a?(Numeric)
  89.       return 3 if damage < 0
  90.       return 2 if critical
  91.       return 0
  92.     else
  93.       return 4  # 文字
  94.     end
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● ゲージピクチャ の矩形
  98.   #--------------------------------------------------------------------------
  99.   def self.guage_rect(type=0, rate=1.0, w=0, h=0)
  100.     bitmap = Cache.system("guage")
  101.     ww = (bitmap.width - w) * rate
  102.     hh = bitmap.height / 5
  103.     Rect.new(w/2, type*hh, ww, hh)
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # ● ゲージピクチャ の描画
  107.   #--------------------------------------------------------------------------
  108.   def self.draw_guage_picture(bitmap, x, y, type, rate)
  109.     bitmap.blt(x, y, Cache.system("guage"), guage_rect(0))
  110.     bitmap.blt(x, y, Cache.system("guage"), guage_rect(type, rate, 2, 2))
  111.     bitmap.blt(x, y, Cache.system("guage"), guage_rect(4))
  112.   end
  113. end


  114. #==============================================================================
  115. # ■ Window_Base
  116. #==============================================================================
  117. class Window_Base < Window
  118.   #--------------------------------------------------------------------------
  119.   # ● HP/MP/TP/Act文字 の描画
  120.   #--------------------------------------------------------------------------
  121.   def draw_bt_text(index, x, y)
  122.     DrawFvPictures.draw_bt_text(contents, index, x, y)
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 数値ピクチャ の描画
  126.   #--------------------------------------------------------------------------
  127.   def draw_nums_picture(x, y, width, num, type=0, align=2)
  128.     DrawFvPictures.draw_nums_picture(contents, x, y, width, line_height, num, type, align)
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ● ゲージピクチャ の矩形
  132.   #--------------------------------------------------------------------------
  133.   def guage_rect(type=0, rate=1.0, w=0, h=0)
  134.     DrawFvPictures.guage_rect(contents, type, rate, w, h)
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● ゲージピクチャ の描画
  138.   #--------------------------------------------------------------------------
  139.   def draw_guage_picture(x, y, type, rate)
  140.     DrawFvPictures.draw_guage_picture(contents, x, y, type, rate)
  141.   end
  142. end

  143. #==============================================================================
  144. # ■ Window_BattleStatus
  145. #==============================================================================
  146. class Window_BattleStatus < Window_Selectable
  147.   #--------------------------------------------------------------------------
  148.   # ● HP の描画
  149.   #--------------------------------------------------------------------------
  150.   def draw_actor_hp(actor, x, y, width = 124)
  151. #~     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  152. #~     change_color(system_color)
  153. #~     draw_text(x, y, 30, line_height, Vocab::hp_a)
  154. #~     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  155. #~       hp_color(actor), normal_color)
  156.     draw_guage_picture(x+84, y-20, 1, actor.fv_prm.hp_rate)
  157.     draw_bt_text(0, x+84, y-12)
  158.     draw_nums_picture(x+84, y-20, width, actor.fv_prm.hp.current, DrawFvPictures.hp_color_type(actor))
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● MP の描画
  162.   #--------------------------------------------------------------------------
  163.   def draw_actor_mp(actor, x, y, width = 124)
  164. #~     draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  165. #~     change_color(system_color)
  166. #~     draw_text(x, y, 30, line_height, Vocab::mp_a)
  167. #~     draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  168. #~       mp_color(actor), normal_color)
  169.     draw_guage_picture(x+84, y-20, 2, actor.fv_prm.mp_rate)
  170.     draw_bt_text(1, x+84, y-12)
  171.     draw_nums_picture(x+84, y-20, width, actor.fv_prm.mp.current, DrawFvPictures.mp_color_type(actor))
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # ● TP の描画
  175.   #--------------------------------------------------------------------------
  176.   def draw_actor_tp(actor, x, y, width = 124)
  177. #~     draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  178. #~     change_color(system_color)
  179. #~     draw_text(x, y, 30, line_height, Vocab::tp_a)
  180. #~     change_color(tp_color(actor))
  181. #~     draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
  182.     draw_guage_picture(x+84, y-20, 3, actor.fv_prm.tp_rate)
  183.     draw_bt_text(2, x+84, y-12)
  184.     draw_nums_picture(x+84, y-20, width, actor.fv_prm.tp.current.to_i, DrawFvPictures.tp_color_type(actor))
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● HP の再描画
  188.   #--------------------------------------------------------------------------
  189.   def redraw_actor_hp(index)
  190.     r = gauge_area_rect(index)
  191.     r.y += gauge_line_height * 0
  192.     r.height = gauge_line_height
  193.     contents.clear_rect(r)
  194.     draw_actor_hp(i_actor(index), r.x, r.y, r.width)
  195.   end
  196.   #--------------------------------------------------------------------------
  197.   # ● MP の再描画
  198.   #--------------------------------------------------------------------------
  199.   def redraw_actor_mp(index)
  200.     r = gauge_area_rect(index)
  201.     r.y += gauge_line_height * 1
  202.     r.height = gauge_line_height
  203.     contents.clear_rect(r)
  204.     draw_actor_mp(i_actor(index), r.x, r.y, r.width)
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● TP の再描画
  208.   #--------------------------------------------------------------------------
  209.   def redraw_actor_tp(index)
  210. #~     return unless $data_system.opt_display_tp
  211.     r = gauge_area_rect(index)
  212.     r.y += gauge_line_height * 2
  213.     r.height = gauge_line_height
  214.     contents.clear_rect(r)
  215.     draw_actor_tp(i_actor(index), r.x, r.y, r.width)
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ● アクション文字描画
  219.   #--------------------------------------------------------------------------
  220.   def draw_action_text(x, y)
  221.     change_color(system_color)
  222.     contents.font.size = 15
  223.     draw_bt_text(3, x, y+8)
  224.     contents.font.size = Font.default_size
  225.     change_color(normal_color)
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ● 戦闘コマンドアイコンの描画
  229.   #--------------------------------------------------------------------------
  230.   def draw_bt_cmd_icon(index, enable=true)
  231.     rect = action_area_rect(index)
  232.     contents.fill_rect(Rect.new(rect.x, rect.y+22, 24, 28), BtlrFv::BACK_COLOR)
  233.     draw_action_text(rect.x, rect.y+6)
  234.     draw_icon(i_actor(index).act_icon, rect.x, rect.y+16) if enable
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 戦闘コマンドアイコンの再描画
  238.   #--------------------------------------------------------------------------
  239.   def redraw_bt_cmd_icon(index, redraw=true)
  240.     contents.clear_rect(action_area_rect(index))
  241.     draw_bt_cmd_icon(index, redraw)
  242.   end
  243. end
复制代码
梦石
0
星屑
200
在线时间
120 小时
注册时间
2007-8-17
回帖
128
发表于 2013-3-27 15:50:30 | 显示全部楼层
有没有范例工程?
回复

使用道具 举报

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-1-11
回帖
14
 楼主| 发表于 2013-3-27 16:18:25 | 显示全部楼层
千昭 发表于 2013-3-27 15:50
有没有范例工程?

http://pan.baidu.com/share/link?shareid=396247&uk=3675150025

感谢大手关注,这是工程,我由200多M压缩到了12M了

点评

多谢多谢,我调到头都昏了  发表于 2013-3-27 19:06
看我等级 我也不过是初学者 一起研究可以 大手称不上,我先看看 耐心等等吧 如果没有其他大手先帮你解决了  发表于 2013-3-27 17:39
回复

使用道具 举报

梦石
0
星屑
200
在线时间
120 小时
注册时间
2007-8-17
回帖
128
发表于 2013-3-27 22:00:07 | 显示全部楼层
本帖最后由 千昭 于 2013-3-27 22:26 编辑

还不是很完善,
有一点点的小问题,防御后的技能图标不消失

1.这是效果图
QQ截图20130327220112.jpg

2.这是“窗口”位置对换(实际这只是两个填充颜色的区域)
QQ截图20130327215759.jpg

3.这是那个红色“ACT” 和 攻击技能图标的设置
绘制图标修正.jpg

这是防御图标的位置
防御图标.jpg


4.注释了第一条后 选择的时候就不消失了
QQ截图20130327215846.jpg

5.这是名字的位置
QQ截图20130327215916.jpg


注释保留了原来的设置
按照片修改就会达到效果

刚才第一次编辑有点小错误  已经更正
回复

使用道具 举报

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-1-11
回帖
14
 楼主| 发表于 2013-3-27 22:08:51 | 显示全部楼层
非常感谢啊,原来要调整这几个啊,我只调整了1个脚本,怪不得调不好,真是帮大忙了,学到了

点评

刚才第一次编辑有错误,更正了下,提醒一下  发表于 2013-3-27 22:23
回复

使用道具 举报

梦石
0
星屑
200
在线时间
120 小时
注册时间
2007-8-17
回帖
128
发表于 2013-3-27 22:29:25 | 显示全部楼层
真正是改完了

防御图标不消失的问题  暂时不搞了  也没在你的要求范围内{:2_285:}
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部