multiple viewPorts?

Anything libgdx related goes here!

multiple viewPorts?

Postby unrealwombat » Wed Mar 09, 2016 7:21 pm

Hello folks, I am trying to create a game with LIBGDX. I am new to libgdx and I have some problems with the viewport/camera.
I created a viewport that shows the world and follows the player. (colored orange on the image). On top of it I want to place a label that shows the time. How can I make this? Can I use multiple viewports?
Thank you very much
Attachments
viewport.png
viewport.png (3.23 KiB) Viewed 1353 times
unrealwombat
 
Posts: 8
Joined: Wed Mar 09, 2016 6:56 pm

Re: multiple viewPorts?

Postby evilentity » Wed Mar 09, 2016 7:30 pm

Yes you can. It is a common practice to use ScreenVP for stage with gui and another one for the game.
Looking for a freelancer? PM me!
evilentity
 
Posts: 4618
Joined: Wed Aug 24, 2011 11:37 am

Re: multiple viewPorts?

Postby Merijn » Thu Mar 10, 2016 9:18 am

Don't forget to apply the correct viewport before drawing. You can find more info here: https://github.com/libgdx/libgdx/wiki/Viewports.
Merijn
 
Posts: 45
Joined: Tue Jul 15, 2014 11:19 am

Re: multiple viewPorts?

Postby unrealwombat » Sun Mar 13, 2016 3:47 pm

ok thank you very much. :)
unrealwombat
 
Posts: 8
Joined: Wed Mar 09, 2016 6:56 pm


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot] and 1 guest