Project1
标题:
关于战斗血条的显示!!!!!
[打印本页]
作者:
潇洒GO4回
时间:
2010-7-3 09:54
标题:
关于战斗血条的显示!!!!!
本帖最后由 潇洒GO4回 于 2010-7-4 15:45 编辑
0.jpg
(14.83 KB, 下载次数: 3)
下载附件
保存到相册
2010-7-3 09:52 上传
怎么改才可以把血条弄成有数字显示的...类似这样的
1.jpg
(18.35 KB, 下载次数: 1)
下载附件
保存到相册
2010-7-3 09:53 上传
这是我的血条脚本,会的高手帮下...........
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# 描绘角色血条
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
alias xrxs_bp2_refresh refresh
def refresh
xrxs_bp2_refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = actor.s_x - 444
actor_y = actor.s_y - 354
x1=self.x
y1=self.y
if actor.xiaoshi == nil and actor.dead? == false
draw_actor_hp_meter(actor, actor_x, 10+actor_y,35)
draw_actor_sp_meter(actor, actor_x, 17+actor_y, 35)
draw_actor_exp_meter(actor, actor_x,24+actor_y, 35)
end
end
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● HP描画
#--------------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.fill_rect(x-1, y+83, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.hp / [actor.maxhp,1].max
self.contents.fill_rect(x, y+84, w,1, Color.new(255, 140, 140, 255))
self.contents.fill_rect(x, y+85, w,1, Color.new(180, 18, 0, 255))
self.contents.fill_rect(x, y+86, w,1, Color.new(209, 33, 0,255))
self.contents.fill_rect(x, y+87, w,1, Color.new(180, 18, 0, 255))
end
#--------------------------------------------------------------------------
# ● SP描画
#--------------------------------------------------------------------------
def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.fill_rect(x-1, y+83, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.sp / [actor.maxsp,1].max
self.contents.fill_rect(x, y+84, w,1, Color.new(40, 176, 255, 255))
self.contents.fill_rect(x, y+85, w,1, Color.new(78, 10, 175, 255))
self.contents.fill_rect(x, y+86, w,1, Color.new(94, 10, 214, 255))
self.contents.fill_rect(x, y+87, w,1, Color.new(78, 10, 175, 255))
end
#--------------------------------------------------------------------------
# ● exp描画
#--------------------------------------------------------------------------
def draw_actor_exp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.fill_rect(x-1, y+83, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.now_exp/[ actor.next_exp,1].max
self.contents.fill_rect(x, y+84, w,1, Color.new(80, 180, 80, 255))
self.contents.fill_rect(x, y+85, w,1, Color.new(80, 180, 80, 255))
self.contents.fill_rect(x, y+86, w,1, Color.new(80, 180, 80, 255))
self.contents.fill_rect(x, y+87, w,1, Color.new(80, 180, 80, 255))
end
end
作者:
henbas
时间:
2010-7-3 10:50
string = actor.hp
self.contents.draw_text(x, y, width, height, string[, align])
复制代码
看你要畫在哪裡:)
作者:
潇洒GO4回
时间:
2010-7-3 12:09
这个要加在哪的?
作者:
逆鳞R
时间:
2010-7-3 16:03
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1