Playdate.graphics.imagetable:load not working?

Not sure if I’m doing this wrong or if the function is bugged, so apologies if this isn’t the right place. Tried to search the forum but couldn’t find anything.

I try to load a new gif into a previously created imagetable that has the same frames size and number of frames, but the function returns an error.

This is how I do it. First I create an image table:

Distant_Waves_ImageTable = gfx.imagetable.new('assets/images/environment/waves_distant_1.gif')

Then I try to replace it with a new one:

Distant_Waves_ImageTable:load('assets/images/environment/waves_distant_2.gif')

But I get: assets/images/environment/waves_distant_2.gif not found: No such file

I tried to create an empty table with the number of frames:

Distant_Waves_ImageTable = gfx.imagetable.new(29)

I get the same message. The documentation mentions something about allocating the memory with count, [cellsWide], [cellSize] arguments but I don’t quite understand how this works, or if this has anything to do with the function not loading, because the error says it doesn’t find the file.

I’d appreciate help on this.

Thanks

Lua, I assume?

I don’t know how the allocation cellSize issue works either, but have you tried omitting the extension “.gif” from the code? (I’ve only used .pngs myself, but you definitely omit the extension for those.)

I’ve also never tried using single quotes around path names, although they may be fine for all I know!

Well how about that. You DO need to omit the extension. I could have poked forever. Both simple quotation and double quotation marks work though

So I guess maybe changing the function so that load() and new() both have a consistent behavior as to naming convention. Kind of confusiong that one accepts extensions but not the other?

My preference would go to accepting with and without extension, simple or double quotation marks. Makes sense to be as lenient as possible.

Thank you for finding this :slight_smile:

2 Likes