HUD/Font Aspect Ratio theory

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

HUD/Font Aspect Ratio theory

Post by starman2049 »

I've got a cross-platform game that was built for 4:3 aspect ratio and am trying to figure out how to best adjust the HUD/Font/Shell/Menuing system to adapt to the 16:9 on PSP.

As a quick hack I just played around with scale the best I could so that fonts and other hud elements were scaled to close to where they should be on screen while at the same time being as little stretched as possible.

Is there some super-simple approach that I am missing to acheive this? Or do I just need two versions of my shell code - one that get's my positions right for 4:3 and another hat gets it right for 16:9?
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

best approach is really to use
#ifdef (PSP)
// psp specific stuff to run
#endif

to have full control over seperate versions
of your game ....as for fonts you should simply
change their positioning on the psp x, y axis

ex.

Code: Select all

FONT* font

#ifdef (WIN)
 // win stuff do to 
#endif 

#ifdef (PSP)
  font->f_x = 2;
  font->f_y = (SCREEN_HEIGHT - 12);  
  fntPosition(font, font->f_x, font->f_y);
  fntPrintToScreen("Score: %d", s_count);
  // and etc...
#endif

// continue your fun ...  
handling different placement of HUD, fonts, and
anything else has more control for you when you
handle yourself ...of course you could be lazy and use
#define to set how you want the app to set screen height
and width but this will make you go around searching for
more problems than you really need
10011011 00101010 11010111 10001001 10111010
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

OK, thanks for the input. This is what I figured, but I wanted to make sure there wasn't something obvious that I was missing before I recode my whole shell/hud.

I see what you mean about coding to width/height relative values, that's a good tip...

Thanks!
Post Reply