That is the error I am receiving while trying to create a pie timer. Please note, this code requires mathlib.
local function newCycle( parent, x, y, inner, outer, from, range ) range = range or 1 if (range \< 1) then range = 1 elseif (range \> 360) then range = 360 end local centre = {x=0,y=0} local offsetY = -(inner+(outer-inner)/2) local pt = {x=0, y=offsetY} pt = math.rotateTo( pt, from, centre ) local path = {pt.x,pt.y} for i=1, range do pt = math.rotateTo( pt, 1, centre ) path[#path+1] = pt.x path[#path+1] = pt.y end -- this is the line that causes the error local line = display.newLine( parent, unpack( path ) ) line.strokeWidth = outer-inner return line end local function newTimer( parent, x, y, inner, outer, colour, from, range, time ) local group = display.newGroup() group.x, group.y = x, y group.i = 1 local function render() if (group.numChildren) then if (group.numChildren \> 0) then group[1]:removeSelf() end end local line = newCycle( group, 0, 0, inner, outer, from, group.i ) line:setStrokeColor( colour[1], colour[2], colour[3], colour[4] or 1 ) end local function onComplete() Runtime:removeEventListener( "enterFrame", render ) end transition.to( group, { time=time, i=range, onComplete=onComplete } ) Runtime:addEventListener( "enterFrame", render ) return group end When using this line of code; the error pops up: pieTimer = newTimer( display.currentStage, 161, 460, 0, 16, {.41,.39,.25,.45}, 00, 368, 2000 )
Here is a screenshot of the error:
https://www.dropbox.com/s/9nk60tw6eyqvj1w/error.png?dl=0
Anyone have any ideas?