- 注册时间
- 2004-11-7
- 最后登录
- 2009-7-28
⑦老手
pliskin
- 积分
- 7004
|
发表于 2006-7-20 19:37:57
|
显示全部楼层
class Scene_sizz
def main
@sizz_window = Window_sizz.new
@sizz_window.x = 640
@sizz_window.y = 480
Graphics.transition
loop do
Graphics.update
Input.update
@sizz_window.update
if Input.trigger?(Input::B)
$scene = Scene_Menu.new
@sizz_window.dispose
return
end
if $scene != self
break
end
end
Graphics.freeze
@sizz_window.dispose
end
end
class Window_sizz < Window_Base
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height-32 )
refresh
end
def refresh
self.contents.clear
color=crisis_color
self.contents.drawcircle(300, 240, 30, crisis_color)
end
end
----------------------------------------------------------------
#圆形的绘制
class Bitmap
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, 255, 64, 255) #颜色的设置
self.set_pixel(x, y, color) #描点
end
end
end
-----
核心在最后一段,前面都是废话 |
|