function param1() return "fore width", 1, 100, 3 end function param2() return "bg width", 1, 100, 3 end function circle( mx, my, w ) mx = math.floor( mx ) my = math.floor( my ) w = math.ceil( w ) local p1 = bs_param1() local p2 = bs_param2() local n = p1 + p2 local sx = mx - w local dx = mx + w local x for x=sx,dx do local px = x - mx local s = w*w - px*px if s > 0 then s = math.sqrt( s ) local ly = my - s local ry = my + s local r,g,b = bs_bg() if x % n < p1 then r,g,b = bs_fore() end bs_rect( x,ly, 1, (ry-ly), r,g,b,255 ) end end end function main( x, y, p ) local w = bs_width() if w < 0.25 then w = 0.25 end local updateDist = w / 2 if w > 5 then updateDist = w/4 end if w > 20 then updateDist = w/10 end if w > 100 then updateDist = w/14 end if not firstDraw then local distance = bs_distance( lastDrawX - x, lastDrawY - y ) if distance < updateDist then return 0 end end circle( x,y, w ) lastDrawX = x lastDrawY = y firstDraw = false return 1 end lastDrawX = 0 lastDrawY = 0 firstDraw = true