Using SDK 2.0.1.
When calling moveTo()
on a sprite that was once visible, but is now set invisible, the sprite is still causing a screen update on the rect where it was last visible.
A super simple repro case using a blinking sprite moving from left to right:
import 'truck.png'
import 'CoreLibs/sprites'
local x = 0
local sprite = playdate.graphics.sprite.new(playdate.graphics.image.new('truck'))
sprite:add()
function playdate.update()
x += 3
sprite:moveTo(x, 120)
sprite:setVisible(x % 100 >= 50)
playdate.graphics.sprite.update()
end
There are redraws happening where nothing is changing:
The example above is in Lua but I'm seeing this in C as well.