- 注册时间
- 2004-11-7
- 最后登录
- 2009-7-28
⑦老手
pliskin
- 积分
- 7004
|
class Window_var < Window_Base
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height-32 )
refresh
end
def refresh
self.contents.clear
self.opacity = 0
#rect =Rect.new( 0, 0, $game_variables[1],32)
color=crisis_color
x0=320
y0=240
r=30
self.contents.drawcircle(x0, y0, r, color, start=0, fin=360)
#self.contents.fill_rect( rect,color)
end
end
#圆形的绘制
def drawcircle(x0, y0, r, color, start=0, fin=360)
x0 = 300 #圆心
y0 = 240 #圆心
r = 30 #半径
fin += 360 if fin < start
for i in start...fin
x = x0 + Integer(r * Math.cos(Math: I * i / 180))
y = y0 + Integer(r * Math.sin(Math: I * i / 180))
color=Color.new(255, 0, 0, 0) #颜色的设置
self.set_pixel(x, y, color) #描点
end
end
一个在窗口中显示圆形的脚本,但是不知道是颜色不对,还是什么的,没有显示 |
|