Sign in to follow this  
Finalspace

Hud rendering scale/position/text

Recommended Posts

Finalspace    1140
Hi,

i am currently writing a 2D Platformer with Java and LWJGL. I am at the point where i want
to display a hud - for displaying player lives, score, etc. and render an UI for my integrated level editor.

The game is designed to run with every screen resolution, the entire orthographic projection is scaled and positioned with a simple factor based on the designed screen size and current screen size. No need to calculate ratio, add cinematic borders, etc. Not sure if that is the correct way for handling different screen resolutions but works for my game, cause the camera is always centered on the player and zoomed based on the above factor.

But how to design/render and UI/HUD for my game which works my different screen resolutions too, i havent figured that out yet.

If i use a fixed screen size for hud/ui rendering everything will be fine, until the screen resolution is changed to an different aspect ratio, for example switching from 4/3 to 16/9 will stretch rendering. But switching from 800 x 600 to 1600 x 1200 will work fine.

Is there a good explanation how to design/render HUD´s for different screen resolutions / aspect ratios?

Here is a small video for showing the current handling of the zoom based on screen size:
[url="http://www.youtube.com/watch?v=rnmBIJmOKzk"]http://www.youtube.com/watch?v=rnmBIJmOKzk[/url]

Thanks in advance,
Final

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this