API for animation loops has changed in the Lua SDK

I can't create animation loops any longer as playdate.graphics.animation.loop.new isn't happy with anything I pass to it anymore.

Most of my animations are from images written to disk and pulled into imagetables like this:

local imageTable = playdate.graphics.imagetable.new(path)
local loop = playdate.graphics.animation.loop.new(delay, imageTable, true)

I also like to create animation loops dynamically, sort of like this:

local imageTable = playdate.graphics.imagetable.new(frameCount)
for i = 1, frameCount do
local image = playdate.graphics.image.new(w, h, clear)
-- draw something on the image using lockFocus(), unlockFocus()
imageTable:setImage(i, image)
end
local loop = playdate.graphics.animation.loop.new(delay, imageTable, true)

Here is the error:

CoreLibs/animation.lua:134: playdate.graphics.animation.loop.new(): imageTable argument must be a playdate.graphics.imagetable
stack traceback:
[C]: in function 'assert'
CoreLibs/animation.lua:134: in field 'new'

Commenting out animation.lua line 134 allows my app to build and run as expected with working animations. I even tried something like setmetatable() before calling loop.new() but that didn't work. Lua is new to me and I'm still unclear on why, when for setmetatable, getmetatable.

Before I discovered animation.loop.new() I had written my own solution but it didn't offer a configurable delay, which is a really nice feature.

I looked in the Examples folder in the SDK but nothing there uses playdate.graphics.animation.loop.new().

I hope I've explained the issue well.

Side note:

__stub.lua in the 2.7.1 SDK omits the 'shouldLoop' parameter for playdate.graphics.animation.loop.new()

It looks like maybe I was getting away with something that is no longer supported- creating a basic table of images and passing that to animation.loop.new() for my animations.

I was able to track down the places where I was passing tables of images to graphics.animation.loop.new() and replace those with bona fide graphics.imagetable.new() calls.

So I think I'll be able to survive this update.

The note about the reference to loop.new in __stub.lua still applies but the only side effect of that is a squiggly line in my IDE so I think I'll be okay.