Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bitmap
- # // 04/15/2012
- def draw_circle(circle,color,fill=false)
- x, y = nil, nil
- mcircle = circle.clone
- for i in 0...360
- if(fill)
- x, y = circle.get_angle_xy(i)
- set_pixel(x,y,color)
- else
- circle = mcircle.clone
- for r in 0...mcircle.radius
- circle.radius = r
- x, y = circle.get_angle_xy(i)
- set_pixel(x,y,color)
- end
- end
- end
- end
- end
- # // Test
- MouseEx.init
- bmp = Bitmap.new(256,256)
- circle = Circle.new(128,128,98)
- bmp.draw_circle(circle,Pallete[:sys_orange])
- spr = Sprite.new()
- spr.bitmap = bmp
- spr.salign(1,1)
- loop do
- Main.update
- spr.update
- end
Advertisement
Add Comment
Please, Sign In to add comment