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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Shadowblitz16
Citizen
Posts: 73
Joined: Wed Oct 28, 2015 11:18 pm

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

Post 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()
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 14 guests