Page 1 of 1

love.graphics set and get matrix instead of add or multiply

Posted: Tue Jan 07, 2020 11:27 pm
by Shadowblitz16
is there a way to set and get the graphics matrix without actually multiplying or adding it to the existing one?

something like..

Code: Select all

love.graphics.setRotation(r)
love.graphics.setScale(x,y)
love.graphics.setTranslation(x,y)
love.graphics.getRotation()
love.graphics.getScaleX()
love.graphics.getScaleY()
love.graphics.getTranslationX()
love.graphics.getTranslationY()

Re: love.graphics set and get matrix instead of add or multiply

Posted: Wed Jan 08, 2020 12:03 am
by zorg
you can love.graphics.push the current one, call love.graphics.origin so it'll be reset, then set the new properities;
11.x added transform objects too, and using love.graphics.replaceTransform method does what you want, probably (although you'd need to use transform objects with that)