I found a rendering error that happens only in a very specific case.
When you render a bitmap rotated 90 degrees exactly partially out of the right side of the screen (or a bitmap rotated 270 degrees partially out of the left side of the screen), a rendering artefact occurs. The gif below demonstrate this error:
(This error has only been tested on simulator, and I don't know if it occurs on console as well)
I am experiencing a similar issue with playdate.graphics.image:drawRotated
In the gif, I have images that are from an image table being drawn within an image-less-sprite's drawFunction. The images are being rotated. When they leave the screen, the image becomes invisible (even though the sprite's isVisible property remains true). In the gif, you can see an invisible image return to the screen (after being forced out of bounds) as just an unfilled circle (I am drawing these primitive circle shapes for debugging purposes).
There appears to be no way to solve this issue using the existing SDK
Literal edge cases. My hunch is the two aren't related (not that that matters at all) but they're equally annoying. It's in the tracker now, will fix as soon as I can.
Popping in here to bump this this as I'm still seeing this issue on device and simulator with SDK 2.1.1.
Code used to demo the repro in the GIF:
import("CoreLibs/graphics")
local image = playdate.graphics.image.new("asteroid")
local x = 400
local angle = 90
function playdate.update()
playdate.graphics.clear()
playdate.graphics.fillCircleAtPoint(x, 50, 16)
image:drawRotated(x, 120, angle)
if playdate.buttonIsPressed("left") then
x = x - 2
elseif playdate.buttonIsPressed("right") then
x = x + 2
end
if playdate.buttonJustPressed("up") then
angle = angle + 2
elseif playdate.buttonJustPressed("down") then
angle = angle - 2
end
playdate.graphics.drawText("angle="..angle, 0, 0)
end
Not having any luck reproducing it here. I changed my demo for the previous bugfix to draw all four 90-degree rotations, no difference. Added transparency to my test image, still nothing. Is that just a single image being drawn with drawRotatedBitmap()? Anything else unusual that you can think of going on there? Also, could you post the image you're using and I'll try that? Maybe that's where the difference is.
agh! Sorry, I pushed a fix for this and started writing a message here but as usual got distracted by something else. Yes, it was a dumb bug--when I fixed the previous problem by offsetting for the clipped columns at the top of the source I forgot to do the same thing with the mask data.
I'm not sure when the next update will be out, but this will be fixed then!