Argument not being accepted by function
Status: Alpha
Brought to you by:
cwalther
|
From: James C. W. <jfc...@ya...> - 2011-10-09 18:57:13
|
Hi all,
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 is below...Anysuggestions?
Thanks, James
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
|