Page 1 of 1

[SOLVED] Help with camera

Posted: Mon Mar 24, 2014 8:26 pm
by CrocDev
Hey.
I posted another post but people edited there replies so i dont know what to do.

In my game, the camera moves when the player reaches halfway across the screen. but, when i open my pause menu the menu isn't in the middle of the screen. is there a way to reset the camera?

Re: Help with camera

Posted: Mon Mar 24, 2014 8:34 pm
by Azhukar
Look into http://www.love2d.org/wiki/love.graphics.push and http://www.love2d.org/wiki/love.graphics.pop

You need to draw your menu outside of your camera transformations.

Re: Help with camera

Posted: Mon Mar 24, 2014 9:55 pm
by kikito
You can also give a look at my camera lib, gamera:

viewtopic.php?f=5&t=12033

In the demo, the "message on the right" (gamera demo: etc etc) is drawn after the cameras are done drawing, so it is not affected. You can adapt that to draw any UI element, including your dialog.

Re: Help with camera

Posted: Mon Mar 24, 2014 11:28 pm
by pielago
here its a small example about camera and pause maybe could help you .. menu and pause needs to be out of the camera to work perfect

Re: Help with camera

Posted: Fri Mar 28, 2014 7:25 pm
by CrocDev
Thanks to every1 who helped me!!! :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: