Hello!
This is on SDK 2.0.0.
When rotating an image with rotatedImage
it seems like color inversion is ignored. I tried with invertedImage
as well as setInverted
, and neither works.
import "CoreLibs/graphics"
local gfx<const> = playdate.graphics
gfx.pushContext()
gfx.setPattern({0xFF, 0xDD, 0xFF, 0x77, 0xFF, 0xDD, 0xFF, 0x77})
gfx.fillRect(0, 0, 400, 240)
gfx.popContext()
local underlyingImg = gfx.image.new(400, 240);
gfx.pushContext(underlyingImg);
gfx.clear(gfx.kColorClear);
gfx.setColor(gfx.kColorBlack);
gfx.fillCircleAtPoint(50, 50, 25);
gfx.popContext();
-- underlyingImg contains a black circle at 50,50
local finalImg = gfx.image.new(400, 240, gfx.kColorClear);
gfx.pushContext(finalImg);
-- 1
underlyingImg:invertedImage():draw(0, 0)
-- 2
underlyingImg:invertedImage():rotatedImage(0):draw(50, 50)
-- 3
local invertedUnderlyingImg = underlyingImg:invertedImage()
invertedUnderlyingImg:rotatedImage(0):draw(100, 100)
-- 4
local mutatedUnderlyingImg = underlyingImg
mutatedUnderlyingImg:setInverted(true)
mutatedUnderlyingImg:rotatedImage(0):draw(150, 150)
gfx.popContext();
finalImg:draw(0, 0)
playdate.update = function()
end
Additionally, if I try to draw with underlyingImg:invertedImage():drawRotated(0, 0, 0)
the image just doesn't seem to draw at all.
Thanks so much for your help!