Closed JerryVerhoeven closed 2 years ago
Looks like this was me making a typo in the docs, sorry about that. It's supposed to refer to NobleSprite:draw()
(not NobleScene:draw()), which is called like any other sprite in the Playdate SDK's update loop.
Not sure what's preventing it from working in your case. Can you post some code?
This is how I've set it up. Not sure what else I can say except that if I call draw explicitly on the sprite, it does render as expected.
You might want to try having the scene be the one to add the NobleSprite directly, instead of the NobleSprite calling to add itself. So, use self:addSprite(testTargetDownSprite)
inside your NobleScene:init()
function. NobleSprite:add()
, which you are using, will call the current scene's self.addSprite(yourSprite) method, but I don't think the current scene has been changed to the new scene yet when NobleScene:init()
runs. I think it happens on NobleScene:enter()
.
Almost certainly unrelated, but you don't need to include the "table-32-32" part of the filename when you create from a spritesheet.
The documentation typo was fixed in #26. I think the other issue is more a case of "works as designed, but maybe it's designed weirdly?" I'm going to close this issue, but feel free to open a new thread in the discussions tab if I didn't fully address the topic.
Documentation says:
Doesn't seem to be true for me unfortunately.
I'm actually curious where NobleScene:draw() is supposed to be because I haven't found it.