赞 | 15 |
VIP | 1 |
好人卡 | 1 |
积分 | 3 |
经验 | 6140 |
最后登录 | 2024-8-3 |
在线时间 | 214 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 266
- 在线时间
- 214 小时
- 注册时间
- 2008-12-18
- 帖子
- 44
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 fux2 于 2010-11-12 07:05 编辑
- #--------------------------------------------------------------------------
- # ● CPメーター の描画
- #--------------------------------------------------------------------------
- def draw_actor_cp(actor,x,y,width)
- color_b = Color.new(255,255,255,255)
- if actor.cp == actor.maxcp
- r = 128
- g = 0
- b = 255
- o = 255
- else
- if actor.cp < actor.maxcp/2
- if actor.cp < actor.maxcp/4
- r = 255
- g = 128
- b = 64
- o = 255
- else
- r = 255
- g = 0
- b = 64
- o = 255
- end
- else
- if actor.cp < actor.maxcp*3/4
- r = 255
- g = 0
- b = 128
- o = 255
- else
- r = 255
- g = 0
- b = 255
- o = 255
- end
- end
- end
- w = width * (actor.cp.to_f / actor.maxcp.to_f)
- #边框
- self.contents.fill_rect(x-1, y-1, width+2, 1, color_b)
- self.contents.fill_rect(x-1, y+10, width+2, 1, color_b)
- self.contents.fill_rect(x-1, y, 1, 10, color_b)
- self.contents.fill_rect(x+width, y, 1, 10, color_b)
- #背景
- self.contents.fill_rect(x, y, width, 10, Color.new(0,0,0,200))
- #描绘
- self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o))
- self.contents.fill_rect(x, y+1, w, 1,Color.new(r+44,g+77,b+10,o))
- self.contents.fill_rect(x, y+2, w, 1,Color.new(r+41,g+73,b+7,o))
- self.contents.fill_rect(x, y+3, w, 1,Color.new(r+38,g+69,b+3,o))
- self.contents.fill_rect(x, y+4, w, 1,Color.new(r+34,g+65,b-1,o))
- self.contents.fill_rect(x, y+5, w, 1,Color.new(r+30,g+60,b-6,o))
- self.contents.fill_rect(x, y+6, w, 1,Color.new(r+10,g+40,b-32,o))
- self.contents.fill_rect(x, y+7, w, 1,Color.new(r+10,g+46,b-37,o))
- self.contents.fill_rect(x, y+8, w, 1,Color.new(r+13,g+59,b-41,o))
- self.contents.fill_rect(x, y+9, w, 1,Color.new(r+18,g+73,b-43,o))
- end
复制代码 这句报错:self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o))
float -1.#IND out of range of integer |
|