How to print text that isn't affected by the camera.scale ?

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.
PGUp
Party member
Posts: 105
Joined: Fri Apr 21, 2017 9:17 am

Re: How to print text that isn't affected by the camera.scale ?

Post by PGUp »

Use love.graphics.push() and love.graphics.pop()
-
User avatar
Harrylechienfou
Prole
Posts: 30
Joined: Tue May 21, 2019 2:02 pm

Re: How to print text that isn't affected by the camera.scale ?

Post by Harrylechienfou »

Thanks for the answers but I still don't understand exactly how to do such a thing :/
User avatar
pgimeno
Party member
Posts: 2602
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to print text that isn't affected by the camera.scale ?

Post by pgimeno »

Harrylechienfou wrote: Tue Jul 09, 2019 5:19 pm I have another question since were're here : what if I want to use the current mouse position to be the center of the screen when I zoom in/out ? Like for example I put the mouse somewhere on the screen when there is a red dot drawn, and because the mouse is wher the red dot is, it will zoom in/out where the mouse is (at the red dot position), but if after that I move my mouse to a blue dot drawn somewhere on the screen, then it will zoom in/out with the camera centered on this blue dot instead.
If I understand correctly, you don't want to actually re-centre the screen (which is what your first sentence suggested) but to do a zoom in/out over an arbitrary point that is not the screen centre.

Take a look at the attached .love file (left click to zoom in, right click to zoom out). If it's what you're after then you'll have to adapt it to your code yourself.

Note: to me, zoom and scale are equivalent, therefore a zoom value of 2 means a 2x zoom. I'm noting it because the camera module that you linked seems to work in terms of inverse zoom, where a value of 2 means a 0.5x zoom.
Attachments
zoom-on-point.love
(68.83 KiB) Downloaded 79 times
Post Reply

Who is online

Users browsing this forum: No registered users and 65 guests