赞 | 0 |
VIP | 97 |
好人卡 | 40 |
积分 | 2 |
经验 | 52485 |
最后登录 | 2020-7-11 |
在线时间 | 1245 小时 |
Lv1.梦旅人 狂気の月兔
- 梦石
- 0
- 星屑
- 236
- 在线时间
- 1245 小时
- 注册时间
- 2009-4-7
- 帖子
- 879
|
- class Sprite_States_Icon < Sprite
- def initialize(actor, x, y, view_area)
- super(view_area)
- @back = Sprite.new(view_area)
- @back.bitmap = Cache.system("Statebox.png")
- @back.opacity = 128
- [url=home.php?mod=space&uid=95897]@actor[/url] = actor
- @states = []
- self.bitmap = Bitmap.new(24 * 4, 24)
- self.x = x
- self.y = y
- @back.x = x
- @back.y = y
- @back.z = 200
- update
- end
-
- def update
- return if @states == @actor.states
- self.bitmap.clear
- @states = @actor.states
- x = 0
- y = 0
- @actor.states.each_with_index do |states, count|
- draw_icon(states.icon_index, x + 24 * count, y)
- break if (24 * count > width - 24)
- end
- end
-
- def draw_icon(icon_index, x, y, enabled = true)
- bitmap = Cache.system("Iconset")
- rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 96)
- self.bitmap.blt(x, y, bitmap, rect, enabled ? 255 : 128)
- end
复制代码 未测试 |
评分
-
查看全部评分
|