My Little Dungeon - LD23 Game

Hey Bach, a different kind of game, cool btw. I liked the bgm.

I have one question… what method do you used to resize the game? Because when we change the size of the window, all the stuff inside changes and keep the proportion (images, texts), and i want to do the same for my game (keep the proportion for all screen resolutions).

I don’t know anything about the libGdx library, i’m not using libraries (except for music and sound), so can it be a native function of the library or something like that?

Thanks.

Ps: Sorry for any english mistakes, i’m in the language learning process.

Hey man,

Libgdx uses opengl for rendering. So unless you use opengl it’d be kinda tricky to do it the same way. Basically you define a viewport (which defines where in the window it should render to). All the 3d stuff (even sprites are 3d, just flat quads) get then projected via a projection matrix to screen coordinates. So the thing that stays consistent is the projection matrix, this way you can always use the same world coordinates in game no matter what the resolution of the window/screen is. The viewport then gets adjusted to fit the screen size and/or resized to keep aspect ratio.

This is from the libgdx doc, probably explains it much better than I ever will: https://code.google.com/p/libgdx/wiki/GraphicsFundamentalsViewport

Hope this helps somewhat!

Cheers,
Bach

thank you, i’ll take a look.

This might help too: https://code.google.com/p/libgdx/wiki/ProjectionViewportCamera

Again, libgdx specific however the concepts explained are the same for anything…

Cheers,
Bach