Hi,
I’m using current code to display an allipse:
function display.newArc(x,y,w,h,s,e)
local xc,yc,xt,yt,cos,sin = x+w/2,y+h/2,0,0,math.cos,math.sin
s,e = s or 0, e or 360
s,e = math.rad(s),math.rad(e)
w,h = w/2,h/2
local l = display.newLine(0,0,0,0)
l:setColor(54, 251, 9)
l.width = 4
mainGroup:insert( l )
for t=s,e,0.02 do l:append(xc + w\*cos(t), yc - h\*sin(t)) end
return l
end
function display.newEllipse(x,y,w,h)
return display.newArc(x,y,w,h)
end
Circle[Number] = display.newEllipse( Area[i].x - (Area[i].width / 2), Area[i].y-(Area[i].height / 2), Area[i].width, Area[i].height)
This works perfectly, but now I want to display it with a certain angle/rotation.
I tried fiddling with it but can’t figure it out. Changing the s and e values didn’t work.
Anyone?
[import]uid: 50459 topic_id: 31973 reply_id: 331973[/import]