How to print text that isn't affected by the camera.scale ?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: How to print text that isn't affected by the camera.scale ?
Use love.graphics.push() and love.graphics.pop()
-
- 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 ?
Thanks for the answers but I still don't understand exactly how to do such a thing :/
Re: How to print text that isn't affected by the camera.scale ?
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.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.
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 138 times
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot], zorg and 2 guests