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

Project1

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

[已经过期] cp描绘出错

[复制链接]

Lv2.观梦者

梦石
0
星屑
256
在线时间
214 小时
注册时间
2008-12-18
帖子
44
跳转到指定楼层
1
发表于 2010-11-11 23:08:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 fux2 于 2010-11-12 07:05 编辑
  1.   #--------------------------------------------------------------------------
  2.   # ● CPメーター の描画
  3.   #--------------------------------------------------------------------------
  4.   def draw_actor_cp(actor,x,y,width)
  5.     color_b = Color.new(255,255,255,255)
  6.     if actor.cp == actor.maxcp
  7.        r = 128
  8.        g = 0
  9.        b = 255
  10.        o = 255
  11.        else
  12.       if actor.cp < actor.maxcp/2
  13.        if actor.cp < actor.maxcp/4
  14.          r = 255
  15.          g = 128
  16.          b = 64
  17.          o = 255
  18.        else
  19.          r = 255
  20.          g = 0
  21.          b = 64
  22.          o = 255
  23.        end
  24.      else
  25.        if actor.cp < actor.maxcp*3/4
  26.          r = 255
  27.          g = 0
  28.          b = 128
  29.          o = 255
  30.        else
  31.          r = 255
  32.          g = 0
  33.          b = 255
  34.          o = 255
  35.        end
  36.      end
  37.    end
  38.     w = width * (actor.cp.to_f / actor.maxcp.to_f)
  39.     #边框
  40.     self.contents.fill_rect(x-1, y-1, width+2, 1, color_b)
  41.     self.contents.fill_rect(x-1, y+10, width+2, 1, color_b)
  42.     self.contents.fill_rect(x-1, y, 1, 10, color_b)
  43.     self.contents.fill_rect(x+width, y, 1, 10, color_b)
  44.     #背景
  45.     self.contents.fill_rect(x, y, width, 10, Color.new(0,0,0,200))
  46.     #描绘
  47.     self.contents.fill_rect(x, y, w, 1,Color.new(r+46,g+79,b+12,o))
  48.     self.contents.fill_rect(x, y+1, w, 1,Color.new(r+44,g+77,b+10,o))
  49.     self.contents.fill_rect(x, y+2, w, 1,Color.new(r+41,g+73,b+7,o))
  50.     self.contents.fill_rect(x, y+3, w, 1,Color.new(r+38,g+69,b+3,o))
  51.     self.contents.fill_rect(x, y+4, w, 1,Color.new(r+34,g+65,b-1,o))
  52.     self.contents.fill_rect(x, y+5, w, 1,Color.new(r+30,g+60,b-6,o))
  53.     self.contents.fill_rect(x, y+6, w, 1,Color.new(r+10,g+40,b-32,o))
  54.     self.contents.fill_rect(x, y+7, w, 1,Color.new(r+10,g+46,b-37,o))
  55.     self.contents.fill_rect(x, y+8, w, 1,Color.new(r+13,g+59,b-41,o))
  56.     self.contents.fill_rect(x, y+9, w, 1,Color.new(r+18,g+73,b-43,o))
  57.   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
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-4-20 15:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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