查看: 3375|回复: 1

呵呵突然发现血条美化好简单

  [复制链接]

沈黙栤冷

梦石
0
星屑
55
在线时间
5 小时
注册时间
2007-12-15
回帖
2928
发表于 2008-11-1 22:52:49 | 显示全部楼层 |阅读模式

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

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

×
http://rpg.blue/web/htm/news123.htm

从这里的脚本中抽取一点点:



  1.   #-----------------------------------------------------------------------
  2.   # ● HP描画
  3.   #-----------------------------------------------------------------------
  4.   def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  5.     if type == 1 and actor.hp == 0
  6.       return
  7.     end
  8.     self.contents.font.color = system_color
  9.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  10.     w = width * actor.hp / [actor.maxhp,1].max
  11.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  12.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  13.     self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  14.     self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  15.   end
复制代码



比如把上面这个改成:


  1.   # ● HP描画
  2.   #-----------------------------------------------------------------------
  3.   def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  4.     if type == 1 and actor.hp == 0
  5.       return
  6.     end
  7.     self.contents.font.color = system_color
  8.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  9.     w = width * actor.hp / [actor.maxhp,1].max
  10.     for i in 1...100#循环
  11.     s = i*(w/100.00)
  12.     self.contents.fill_rect(x+s, y+28, 1,1, Color.new(155+i, i, i, 255))
  13.     end
  14.   end
复制代码


你会发现,血槽的颜色从,深红,到粉红,非常有趣和简单……


突发的灵感,给大家分享一下。

重来,一切将回更美好?我想不一定,因为苍天给予你的是最美好的结束……阿弥陀佛……(我了个去,关“阿弥陀佛”什么事?)
对于破解游戏,我无话可说,对于破解后宣传,我强烈鄙视,没错,我刚破解了某个正版游戏,想要吗?请自宫后,拿那个东西过来换吧。
……请用行动来支持国产游戏……
PS:谁有仙五破解版啊……(喂!PIA!)
什么情况,汽车漏胎?

梦石
0
星屑
239
在线时间
2399 小时
注册时间
2008-4-11
回帖
11727

贵宾第6届短篇游戏比赛季军

发表于 2008-11-2 02:07:16 | 显示全部楼层
{/cy}谢谢了,我用看看
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部