[SOLVED] Help with camera

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
CrocDev
Prole
Posts: 25
Joined: Tue Jun 11, 2013 7:42 pm

[SOLVED] Help with camera

Post 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?
Last edited by CrocDev on Sat Jun 14, 2014 12:54 pm, edited 1 time in total.
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Help with camera

Post 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.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Help with camera

Post 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.
When I write def I mean function.
pielago
Party member
Posts: 142
Joined: Fri Jun 14, 2013 10:41 am

Re: Help with camera

Post 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
Attachments
pause camera.love
(663.81 KiB) Downloaded 74 times
CrocDev
Prole
Posts: 25
Joined: Tue Jun 11, 2013 7:42 pm

Re: Help with camera

Post by CrocDev »

Thanks to every1 who helped me!!! :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests