It is currently May 24th, 2013, 12:18 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: HUD Manager & Fonts
PostPosted: April 9th, 2010, 3:12 pm 
Offline
3D Simulation Rookie
3D Simulation Rookie
User avatar

Joined: March 30th, 2010, 2:16 pm
Posts: 14
Location: Nice
Hey there,

I'm having some fun creating a Tetris,
and I definitively want to show some texts on the ViewPort.

I quickly found the ViewPort HUDManager but i got a problem with the AddHudText method :
Second parameter represents the Font name.

Will the font given this way be searched on the Windows fonts Dir,
or should it be added as a content and how?

I know it's probably an easy trick but can't get it to work properly.

Best Regards,
Thomas B.


Top
 Profile  
 
 Post subject: Re: HUD Manager & Fonts
PostPosted: April 9th, 2010, 6:05 pm 
Offline
SimplySim Team
SimplySim Team
User avatar

Joined: December 11th, 2008, 7:39 pm
Posts: 118
Hello,

There is a topic on HUD here http://www.simplysim.net/forum/viewtopic.php?f=13&t=502

The HUD manager in the beta is more like "Pre Alpha version" rather that final one ;) But you should be able to do something.

We provide Arial font embedded in the engine ("Fonts_Arial") but it should work with custom fonts too. To use a custom font, you need to compile a font for XNA (generate an xnb). Unfortunately, the Asset Compiler doesn't have an "font" type, so you need to make a classic XNA project in order to do that.

You could follow the first step described here to generate the font xnb : http://msdn.microsoft.com/en-us/library/bb447673.aspx

Once you have your font XNB, just put it into your application content directory, and use the font name (the xnb filename without .xnb) to display your text.

The asset compiler should support font compilation in release version

Regards

_________________
Vincent Maurin
CTO
SimplySim


Top
 Profile  
 
 Post subject: Re: HUD Manager & Fonts
PostPosted: April 9th, 2010, 8:45 pm 
Offline
3D Simulation Rookie
3D Simulation Rookie
User avatar

Joined: March 30th, 2010, 2:16 pm
Posts: 14
Location: Nice
Thanks for the quick answer.

Quote:
There is a topic on HUD here viewtopic.php?f=13&t=502

Seems I failed my search, my bad.

Quote:
you need to make a classic XNA project in order to do that.

I've thought of doing it the XNA way but wanted to be sure there isn't any other tricky way cause it's only a beta.
Anyway I'll use the embedded Arial font (before my first post I tried "Arial" and "Font_Arial"... I was so close).

Thanks again,

Sincerely,
Thomas B.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group. Color scheme by ColorizeIt!