设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2479|回复: 2
打印 上一主题 下一主题

[已经过期] 如何制作HP槽?

 关闭 [复制链接]

Lv2.观梦者

梦石
0
星屑
719
在线时间
684 小时
注册时间
2009-5-29
帖子
461
跳转到指定楼层
1
发表于 2009-12-8 22:40:25 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
不是单纯的系统那种HP槽,而是带有背景图片的,然后用颜色填充……
像这张图的效果……

eg.jpg (15.77 KB, 下载次数: 14)

eg.jpg

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2008-5-31
帖子
237
2
发表于 2009-12-9 09:12:28 | 只看该作者
在 window_base里面有 draw_actor_hp_gauge 的方法
  1.   def draw_actor_hp_gauge(actor, x, y, width = 120)
  2.     gw = width * actor.hp / actor.maxhp
  3.     gc1 = hp_gauge_color1
  4.     gc2 = hp_gauge_color2
  5.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  6.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  7.   end
复制代码
  1.     bitmap = Cache.at("EXP")
  2.     rect = Rect.new(0, 0, 0, 0)
  3.     rect.x = 0
  4.     rect.y = 0
  5.     rect.width = 160
  6.     rect.height = 20
  7.     self.contents.blt(x + 100, y + 80, bitmap, rect)
  8.     bitmap.dispose
  9.     bitmap = Cache.at("gauge")
  10.     rate = actor.next_exp(actor.level, actor.exp)
  11.     rate = rate *125 / 100
  12.     rect = Rect.new(0, 0, 0, 0)
  13.     rect.x = 0
  14.     rect.y = 0
  15.     rect.width = rate
  16.     rect.height = 10
  17.     self.contents.blt(x + 130, y + 87, bitmap, rect)
  18.     bitmap.dispose
复制代码
这是某之前写的经验值的,原理是贴两张图,一张是做衬底,一张是变长度的 做显示
把,稍微改改基本ok。


---------------------------------------------------------------------
关站前稍微混混。。
我。。不是寂寞。。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
719
在线时间
684 小时
注册时间
2009-5-29
帖子
461
3
 楼主| 发表于 2009-12-9 10:44:40 | 只看该作者
了解~3Q~
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-11 17:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表