Advertisement
Guest User

drawCircle

a guest
Oct 31st, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. drawCircle=function(xCenter,yCenter,radius,color,width)
  2.     local coords={}
  3.     local r2=radius*radius
  4.     local x,y
  5.     for x = -radius, radius do
  6.         y=math.sqrt(r2-x*x)+.5
  7.         coords[x+radius+1]={xCenter+x,yCenter+y}
  8.         coords[radius*3-x+2]={xCenter+x,yCenter-y}
  9.     end
  10.     console.canvasDrawPoly(coords,color,width)
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement