0
\$\begingroup\$

I want to start creating a very long project which i will work on and learn from. I've been making some basic games. Now i feel it's tine to step it up a notch.

My idéa is to create a 2.5d game such as Zelda. But i got stuck with viewport and world units. Since there is alot of viewports i can choose from and i've read what they offer. So what is the preferred viewport, dimension and world unit for a 2.5d rpg mobile/desktop game?

Thanks

\$\endgroup\$
1
\$\begingroup\$

Here's a tutorial on viewports: http://www.gamefromscratch.com/post/2014/12/09/LibGDX-Tutorial-Part-17-Viewports.aspx

StrechViewport would be the best as it is simple and works quite well. Some of the other viewports add padding bars to the sides, which might not make your game look good. But, you can try changing the viewports and resizing your window to see which one works best.

You specify the world width and height when initializing the viewport and the viewport scales your game accordingly.

So for a StrechViewport your code would be:

Viewport viewport = new StretchViewport(worldWidth, worldHeight);

And in your screen's resize method (or your own method) you would resize the viewport:

viewport.update(screenWidth, screenHeight);
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.