Any way to get the sprite image drawmode?

,

Is there any way to get the current imageDrawMode from a sprite ? tried sprite:getImageDrawMode() but the method doesn't exist.

No, there's no way currently. I'll file that, and here's a way to make that work in the mean time:

if playdate.graphics.sprite.getImageDrawMode == nil then
    local _setSpriteDrawMode = playdate.graphics.sprite.setImageDrawMode

    playdate.graphics.sprite.setImageDrawMode = function(sprite,mode)
        sprite.drawMode = mode
        _setSpriteDrawMode(sprite,mode)
    end

    playdate.graphics.sprite.getImageDrawMode = function(sprite)
        return sprite.drawMode
    end
end
2 Likes