Puede que esto te sirva
function rotate(image)
local w = image:width()
local h = image:height()
local result = Image.createEmpty(h, w)
for x=0,w-1 do
for y=0,h-1 do
result:pixel(h-y-1, x, image:pixel(x, y))
end
end
return result
end
function printRotated(x, y, text, color, image, rotateIndex)
rotateIndex = math.mod(rotateIndex, 4)
local w = string.len(text)
local result = Image.createEmpty(w * 8, 8)
result:print(0, 0, text, color)
if rotateIndex > 0 then
rotateIndex = rotateIndex - 1
for i=0,rotateIndex do
result = rotate(result)
end
end
image:blit(x, y, result)
end