Talk:love.graphics.translate
Camera shake ahoy!
--Meevere (talk) 20:47, 5 March 2023 (CET) Does this article provide misleading information, or am I stupid..
This article says that if I make `translate(dx,dy)` then when I call draw(x,y), I would effectively get draw(x+dx,y+dy) Then, if I would like to scale something around a point, I would use this piece of code:
function scale_around(origin, scale)
love.graphics.push()
love.graphics.translate(-origin[1],-origin[2]) -- Because if I would call something at the origin I would like to stay it still
love.graphics.scale(scale)
love.graphics.translate(origin[1], origin[2])
end
But it only works if I swap the signs for origin. Is that a bug or am I doing something wrong?