Project1
标题:
呵呵突然发现血条美化好简单
[打印本页]
作者:
cmbljsw
时间:
2008-11-1 22:52
标题:
呵呵突然发现血条美化好简单
http://rpg.blue/web/htm/news123.htm
从这里的脚本中抽取一点点:
#-----------------------------------------------------------------------
# ● HP描画
#-----------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.hp / [actor.maxhp,1].max
self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
end
复制代码
比如把上面这个改成:
# ● HP描画
#-----------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.hp / [actor.maxhp,1].max
for i in 1...100#循环
s = i*(w/100.00)
self.contents.fill_rect(x+s, y+28, 1,1, Color.new(155+i, i, i, 255))
end
end
复制代码
你会发现,血槽的颜色从,深红,到粉红,非常有趣和简单……
突发的灵感,给大家分享一下。
作者:
一瞬间的幻觉
时间:
2008-11-2 02:07
{/cy}谢谢了,我用看看
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1