In the following code, the line is displaying in the proper position, but I am trying to figure out how to get it to rotate on its middle axis… instead of at the end like it is doing now. Any idea how to do this?
line = display.newRect(display.contentWidth / 2, display.contentHeight / 2 , 300 , 2)
line.anchorX = 0
line.anchorY = 0
local function myFunction()
if line then
– line.anchorX = .5
– line.anchorY = .5
line.rotation = line.rotation + 15
end
end
timer.performWithDelay(1, myFunction, 36)