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 sy = my - w local dy = my + w local y for y=sy,dy do local py = y - my local s = w*w - py*py if s > 0 then s = math.sqrt( s ) local lx = mx - s local rx = mx + s local r,g,b = bs_bg() if y % n < p1 then r,g,b = bs_fore() end bs_rect( lx,y, (rx-lx),1, 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