def HP(actor,x,y,w=74,width=144)
#血条
#HP最大值
@bitmap3 =Bitmap.new("Graphics/Pictures/MHP")
w3=@bitmap3.width
@src_rect3 = Rect.new( 0, 0, w3, @bitmap3.height)
self.contents.blt(x+68,y+58,@bitmap3,@src_rect3)
#HP
@bitmap1 =Bitmap.new("Graphics/Pictures/HP")
w1=@bitmap1.width *actor.hp/actor.maxhp
@src_rect1 = Rect.new( 0, 0, w1, @bitmap1.height)
self.contents.blt(x+68,y+58,@bitmap1,@src_rect1)
hp_x = x
flag = false
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
# 描绘 MaxHP
if flag
self.contents.font.color =normal_color
self.contents.draw_text(hp_x + 20, y+40, 12, 20, "/", 1)
self.contents.draw_number(hp_x + 35, y, actor.maxhp.to_s)
end
end
#技能条
def SP(actor,x,y,w=74,width=144)
#SP最大值
@bitmap4 =Bitmap.new("Graphics/Pictures/MSP")
w4=@bitmap4.width
@src_rect4 = Rect.new( 0, 0, w4, @bitmap4.height)
self.contents.blt(x+68,y+59,@bitmap4,@src_rect4)
#sp
@bitmap2 =Bitmap.new("Graphics/Pictures/SP")
w2=@bitmap2.width *actor.sp/actor.maxsp
@src_rect2 = Rect.new( 0, 0, w2, @bitmap2.height)
self.contents.blt(x+68,y+59,@bitmap2,@src_rect2)
sp_x = x
flag = false
# 描绘 SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
# 描绘 MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 20, y+41, 13, 20, "/", 1)
#把括号后的2去掉,中间的两个数字也去掉,
self.contents.draw_number(sp_x + 35, y, actor.maxsp.to_s)
#把draw_text改为draw_number就行了!!
end
end
#########################################################
def HP(actor,x,y,w=74,width=144)
#血条
#HP最大值
@bitmap3 =Bitmap.new("Graphics/Pictures/MHP")
w3=@bitmap3.width
@src_rect3 = Rect.new( 0, 0, w3, @bitmap3.height)
self.contents.blt(x+68,y+58,@bitmap3,@src_rect3)
#HP
@bitmap1 =Bitmap.new("Graphics/Pictures/HP")
w1=@bitmap1.width *actor.hp/actor.maxhp
@src_rect1 = Rect.new( 0, 0, w1, @bitmap1.height)
self.contents.blt(x+68,y+58,@bitmap1,@src_rect1)
hp_x = x
flag = false
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
# 描绘 MaxHP
if flag
self.contents.font.color =normal_color
self.contents.draw_text(hp_x + 20, y+40, 12, 20, "/", 1)
self.contents.draw_number(hp_x + 35, y, actor.maxhp.to_s)
end
end
#技能条
def SP(actor,x,y,w=74,width=144)
#SP最大值
@bitmap4 =Bitmap.new("Graphics/Pictures/MSP")
w4=@bitmap4.width
@src_rect4 = Rect.new( 0, 0, w4, @bitmap4.height)
self.contents.blt(x+68,y+59,@bitmap4,@src_rect4)
#sp
@bitmap2 =Bitmap.new("Graphics/Pictures/SP")
w2=@bitmap2.width *actor.sp/actor.maxsp
@src_rect2 = Rect.new( 0, 0, w2, @bitmap2.height)
self.contents.blt(x+68,y+59,@bitmap2,@src_rect2)
sp_x = x
flag = false
# 描绘 SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
# 描绘 MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 20, y+41, 13, 20, "/", 1)
#把括号后的2去掉,中间的两个数字也去掉,
self.contents.draw_number(sp_x + 35, y, actor.maxsp.to_s)
#把draw_text改为draw_number就行了!!
end
end
#########################################################