Incorrect animation loop property name in Lua Version 2.1.1 documentation


Inside Playdate Version 2.1.1 documents a parameter and property named shouldLoop. When I iterate the key-value pairs of an animation loop, however, there is no shouldLoop key. There is a loop key with a boolean value, which seems to correspond to shouldLoop in the documentation.


Good call! I've added shouldLoop to the __index metamethod so that the get matches the set. Here's the patch if you want to fix that on your copy before we can get that into an update:

--- a/SDK/CoreLibs/animation.lua
+++ b/SDK/CoreLibs/animation.lua
@@ -49,6 +49,9 @@ loopAnimation.__index = function(table, key)
        elseif key == "paused" then
                return table._paused
+       elseif key == "shouldLoop" then
+               return table.loop
        elseif key == "step" then
                return table._step
1 Like

Thanks, Dave! I applied the patch to my copy, and it worked.