forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HUD/Font Aspect Ratio theory

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Sun Apr 23, 2006 8:01 am    Post subject: HUD/Font Aspect Ratio theory Reply with quote

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?
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Sun Apr 23, 2006 1:07 pm    Post subject: Reply with quote

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:

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
Back to top
View user's profile Send private message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Sun Apr 23, 2006 1:42 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group