libGDX Viewports
HTML-код
- Опубликовано: 17 ноя 2024
- Learn how to implement libGDX's various viewports to improve the scalability and functionality of your game.
Follow along with full transcript and source code here: github.com/rae...
See an interactive demonstration of all the Viewports: raeleus.github...
Lego Batman inspired split screen sample: github.com/Rax...
libGDX Masks: • libGDX Masks
libGDX Viewports Wiki: libgdx.com/wik...
libGDX Camera Wiki: libgdx.com/wik...
A very special thanks to Groxar, Lyze, and Peanut Panda for their contributions to this guide.
Music by Jake Stevens: / jakery1295
I have been actively learning the ins and outs of libGDX for a month and still didn't understanding viewports until this video. Thank you so much!
you deserve way more subscribers my friend, this was an awesome viewports explanation video thank you.
I appreciate you saying that!
when you say "crap" it sounds sooo good
Oh hah hah thanks!
Wow! What a fantastic video! I've struggled my way through many of these concepts without truly "getting it" before. Thank you!
You're welcome!
great video
multiple viewport use case is just what I need
Yaaaaaaaaaaaaaaaaaay I can now feel myself closer than ever to using viewports :D great video :3
I feel enlightened. Thank you.
amazing video, i dont understand why you only have 1k subs
@@Fireball-2000 aww thanks. I appreciate it!
Great tutorial, I can finally feel like I am in a 70s porn film while comprehensively learning about Viewports and their constructors.
the most sexiest viewport tutorial out there
Thank you for saying that!
Great video!
Awesome video, so clear and fun. Wish you many subsribers sir
Thank you!
Great video Raeleus!!
Thank you!
Another great video. Thanks!
Thank you for watching!
gracias por comparir. Bro
Thank you for watching.
Thank you very much, God bless.
You are a GODSEND
Thank you!
i appreciate you!
7:22 where is the link for Groxar's split screen? its not in the masks description either if that's where you meant it was linked
It was in the description of this video, but the link has changed: github.com/Raxorg/Alejandria/blob/master/core/src/com/epicness/alejandria/showcase/modules/viewports/AdvancedSplitScreen.java
thank!
amazing
Sooooo… the Invincible reference at the end means I should be learning unity instead? 😂
You could be, but Unity is evil hah hah
7:00 I'm wondering how you can create such a fixed-size minimap in one of the corners of a fitViewport... So with the minimap moving accordingly to the fitViewport (so it doesn't end up inside the black borders) but without resizing together with the rest of the game.
Can you nest or chain viewports?
I think you can achieve that by manually doing some math when the window is resized. Some viewports have properties like gutter width that you can use.
Great video!
on minute 3:15, why do you have to call apply on screenViewport? On resize method we call update wich already call apply, and on stage.draw() the camera is updated already
When you switch viewports, you have to manually call apply() for the one you're using. Stage does not automatically do this when you call draw(). Thanks for watching.
Right. Thanks for the answer!
What if I don't want to use Box2D but instead want to make my own pixel based collision detection, should I still use "sane" units?
You might be able to get away with it if the world area is small. Sadly it's the nature of floating point arithmetic that the larger the number is, the more inaccurate it becomes. You hit that inaccuracy faster with pixel units. Then you'll have objects tunneling through other objects randomly.
@@raeleus It is assumed that the world is divided into rooms like in Metroid (for example). But I still tempted to test it with world units because in this way I probably won't need to do ceil and floor shenanigans but instead just cut off the fractional part to get the tile index.
you made a minecraft book paster for 1.4 in 2012 didnt you? i just wanna thank you its my favourite thing and it still works in 1.18
Wow, really? I haven't looked at that project in years. Thank you so much!
Please can you help me with my code? I don't know how to use fitviewport
Make sure to ask on the libGDX Discord. RUclips comments are poorly designed for code help.
goood shit