Re: Argument not being accepted by function
Status: Alpha
Brought to you by:
cwalther
|
From: Christian W. <cwa...@gm...> - 2011-10-10 19:23:42
|
> I'm having a bit of difficulty writing up a function to simplify image sequences and make them playable by one line: playVid(stairDoorOpenLeft, 20, 4, 333, 400, 15)
> The first argument specifies the folder the images are in, then the number of frames, then the cube face, the x/y coords, and the framerate. Trouble is when I run it it tells me this : attempt to concatenate local folder, a nil value
The function looks OK in that regard, so if the above is your actual call, then probably the variable stairDoorOpenLeft actually has value nil - have you checked that? Or possibly you didn't mean it to be a variable, but a string literal, i.e. you forgot the quotation marks?
-Christian
> function playVid(folder, frameCnt, face, locX, locY, framerate)
>
> local animpos = 0
> local vid = patch { face = face, x = locX, y = locY, image = " " .. folder .. "/" .. animpos .. ".jpg" }
>
>
> pipmak.schedule(
> framerate,
> function(now, last)
> animpos = animpos + 1
> if animpos > frameCnt then animpos = 0 end
> vid:setimage ( " " .. folder .. "/" .. animpos .. ".jpg" )
> return framerate
> end
> )
> end
|