赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1890 |
最后登录 | 2016-3-9 |
在线时间 | 59 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 59 小时
- 注册时间
- 2013-1-11
- 帖子
- 24
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 ilovejel 于 2013-3-27 23:00 编辑
这个脚本我自己调整了下位置,但是越调越乱。。。求大手指导。。。
/////////////////////////////////////////
希望能调整成这样的
技能出现的位置也不对
一出现状态后打开技能框就会消失了一半
[pre lang="ruby" line="1" file="脚本"]#==============================================================================
# ■ DrawFvPictures : 専用ピクチャ描画モジュール
#==============================================================================
module DrawFvPictures
#--------------------------------------------------------------------------
# ● HP/MP/TP/Act文字 の描画
#--------------------------------------------------------------------------
def self.draw_bt_text(bitmap, index, x, y)
b = Cache.system("bt_text")
hh = b.height / 4
bitmap.blt(x, y, b, Rect.new(0, index * hh, b.width, hh))
end
#--------------------------------------------------------------------------
# ● 数字ピクチャ(1文字) の矩形 [src]
#--------------------------------------------------------------------------
def self.num_rect(index=0, type=0)
b = Cache.system("number")
ww = b.width / 10
hh = b.height / 4
Rect.new(index*ww, type*hh, ww, hh)
end
#--------------------------------------------------------------------------
# ● 数字ピクチャ の矩形 [width, height]
#--------------------------------------------------------------------------
def self.text_size(num)
if damage_type(num) == 4
b = Cache.system(num)
Rect.new(0, 0, b.width, b.height)
else
b = Cache.system("number")
Rect.new(0, 0, num.to_s.split("").size * (b.width / 10), b.height / 4)
end
end
#--------------------------------------------------------------------------
# ● 数字ピクチャ(1文字) の描画
#--------------------------------------------------------------------------
def self.draw_num_picture(bitmap, x, y, height, num, type=0)
r = num_rect(num, type)
yy = (height - r.height) / 2
bitmap.blt(x, y+yy, Cache.system("number"), r)
r.width
end
#--------------------------------------------------------------------------
# ● 数値ピクチャ の描画
#--------------------------------------------------------------------------
def self.draw_nums_picture(bitmap, x, y, width, height, num, type=0, align=2)
nums = num.to_s.split("").collect { |i| i.to_i }
case align
when 1; x += (width - num_rect(0, type).width * nums.size) / 2
when 2; x += width - num_rect(0, type).width * nums.size
end
nums.each { |n| x += draw_num_picture(bitmap, x, y, height, n, type) }
end
#--------------------------------------------------------------------------
# ● ダメージ用文字ピクチャ の矩形
#--------------------------------------------------------------------------
def self.draw_dmg_text(bitmap, x, y, file)
b = Cache.system(file)
bitmap.blt(x, y, b, Rect.new(0,0,b.width,b.height))
end
#--------------------------------------------------------------------------
# ● HP の文字色を取得
#--------------------------------------------------------------------------
def self.hp_color_type(actor)
return 2 if actor.fv_prm.hp.current == 0
return 1 if actor.fv_prm.hp.current < actor.mhp / 4
return 0
end
#--------------------------------------------------------------------------
# ● MP の文字色を取得
#--------------------------------------------------------------------------
def self.mp_color_type(actor)
return 2 if actor.fv_prm.mp.current == 0
return 1 if actor.fv_prm.mp.current < actor.mmp / 4
return 0
end
#--------------------------------------------------------------------------
# ● TP の文字色を取得
#--------------------------------------------------------------------------
def self.tp_color_type(actor)
return 2 if actor.fv_prm.tp.current == actor.max_tp
return 0
end
#--------------------------------------------------------------------------
# ● ダメージ種別を取得
#--------------------------------------------------------------------------
def self.damage_type(damage, critical=false)
if damage.is_a?(Numeric)
return 3 if damage < 0
return 2 if critical
return 0
else
return 4 # 文字
end
end
#--------------------------------------------------------------------------
# ● ゲージピクチャ の矩形
#--------------------------------------------------------------------------
def self.guage_rect(type=0, rate=1.0, w=0, h=0)
bitmap = Cache.system("guage")
ww = (bitmap.width - w) * rate
hh = bitmap.height / 5
Rect.new(w/2, type*hh, ww, hh)
end
#--------------------------------------------------------------------------
# ● ゲージピクチャ の描画
#--------------------------------------------------------------------------
def self.draw_guage_picture(bitmap, x, y, type, rate)
bitmap.blt(x, y, Cache.system("guage"), guage_rect(0))
bitmap.blt(x, y, Cache.system("guage"), guage_rect(type, rate, 2, 2))
bitmap.blt(x, y, Cache.system("guage"), guage_rect(4))
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● HP/MP/TP/Act文字 の描画
#--------------------------------------------------------------------------
def draw_bt_text(index, x, y)
DrawFvPictures.draw_bt_text(contents, index, x, y)
end
#--------------------------------------------------------------------------
# ● 数値ピクチャ の描画
#--------------------------------------------------------------------------
def draw_nums_picture(x, y, width, num, type=0, align=2)
DrawFvPictures.draw_nums_picture(contents, x, y, width, line_height, num, type, align)
end
#--------------------------------------------------------------------------
# ● ゲージピクチャ の矩形
#--------------------------------------------------------------------------
def guage_rect(type=0, rate=1.0, w=0, h=0)
DrawFvPictures.guage_rect(contents, type, rate, w, h)
end
#--------------------------------------------------------------------------
# ● ゲージピクチャ の描画
#--------------------------------------------------------------------------
def draw_guage_picture(x, y, type, rate)
DrawFvPictures.draw_guage_picture(contents, x, y, type, rate)
end
end
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● HP の描画
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 124)
#~ draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
#~ change_color(system_color)
#~ draw_text(x, y, 30, line_height, Vocab::hp_a)
#~ draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
#~ hp_color(actor), normal_color)
draw_guage_picture(x+84, y-20, 1, actor.fv_prm.hp_rate)
draw_bt_text(0, x+84, y-12)
draw_nums_picture(x+84, y-20, width, actor.fv_prm.hp.current, DrawFvPictures.hp_color_type(actor))
end
#--------------------------------------------------------------------------
# ● MP の描画
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 124)
#~ draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
#~ change_color(system_color)
#~ draw_text(x, y, 30, line_height, Vocab::mp_a)
#~ draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
#~ mp_color(actor), normal_color)
draw_guage_picture(x+84, y-20, 2, actor.fv_prm.mp_rate)
draw_bt_text(1, x+84, y-12)
draw_nums_picture(x+84, y-20, width, actor.fv_prm.mp.current, DrawFvPictures.mp_color_type(actor))
end
#--------------------------------------------------------------------------
# ● TP の描画
#--------------------------------------------------------------------------
def draw_actor_tp(actor, x, y, width = 124)
#~ draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
#~ change_color(system_color)
#~ draw_text(x, y, 30, line_height, Vocab::tp_a)
#~ change_color(tp_color(actor))
#~ draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
draw_guage_picture(x+84, y-20, 3, actor.fv_prm.tp_rate)
draw_bt_text(2, x+84, y-12)
draw_nums_picture(x+84, y-20, width, actor.fv_prm.tp.current.to_i, DrawFvPictures.tp_color_type(actor))
end
#--------------------------------------------------------------------------
# ● HP の再描画
#--------------------------------------------------------------------------
def redraw_actor_hp(index)
r = gauge_area_rect(index)
r.y += gauge_line_height * 0
r.height = gauge_line_height
contents.clear_rect(r)
draw_actor_hp(i_actor(index), r.x, r.y, r.width)
end
#--------------------------------------------------------------------------
# ● MP の再描画
#--------------------------------------------------------------------------
def redraw_actor_mp(index)
r = gauge_area_rect(index)
r.y += gauge_line_height * 1
r.height = gauge_line_height
contents.clear_rect(r)
draw_actor_mp(i_actor(index), r.x, r.y, r.width)
end
#--------------------------------------------------------------------------
# ● TP の再描画
#--------------------------------------------------------------------------
def redraw_actor_tp(index)
#~ return unless $data_system.opt_display_tp
r = gauge_area_rect(index)
r.y += gauge_line_height * 2
r.height = gauge_line_height
contents.clear_rect(r)
draw_actor_tp(i_actor(index), r.x, r.y, r.width)
end
#--------------------------------------------------------------------------
# ● アクション文字描画
#--------------------------------------------------------------------------
def draw_action_text(x, y)
change_color(system_color)
contents.font.size = 15
draw_bt_text(3, x, y+8)
contents.font.size = Font.default_size
change_color(normal_color)
end
#--------------------------------------------------------------------------
# ● 戦闘コマンドアイコンの描画
#--------------------------------------------------------------------------
def draw_bt_cmd_icon(index, enable=true)
rect = action_area_rect(index)
contents.fill_rect(Rect.new(rect.x, rect.y+22, 24, 28), BtlrFv::BACK_COLOR)
draw_action_text(rect.x, rect.y+6)
draw_icon(i_actor(index).act_icon, rect.x, rect.y+16) if enable
end
#--------------------------------------------------------------------------
# ● 戦闘コマンドアイコンの再描画
#--------------------------------------------------------------------------
def redraw_bt_cmd_icon(index, redraw=true)
contents.clear_rect(action_area_rect(index))
draw_bt_cmd_icon(index, redraw)
end
end
[/pre] |
|