function use_base() return true end function param1() return "数", 2, 32, 5 end function param2() return "筆圧透明度", 0, 1, 0 end function main( x, y, p ) if firstDraw then firstDrawX = x firstDrawY = y end local w = bs_width() if w < 0.25 then w = 0.25 end local updateDist = w / 4 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 local bsx,bsy = bs_base() local noInit = (bsx == -1) and (bsy == -1) if noInit then bsx = firstDrawX bsy = firstDrawY end local num = bs_param1() local r,g,b = bs_fore() local a = bs_opaque() * 255 if bs_param2() == 1 then a = p * a end local i for i=0,num-1 do local vx,vy = bs_rotate( x-bsx, y-bsy, 3.14159*2 / num * i ) bs_ellipse( bsx + vx, bsy + vy, w,w, 0, r,g,b, a ) end lastDrawX = x lastDrawY = y firstDraw = false return 1 end bs_setmode( 1 ) lastDrawX = 0 lastDrawY = 0 firstDraw = true firstDrawX = 0 firstDrawY = 0