Rotating text

ztarsson's picture

Hi,

I'm new to 3D-programming, new to XNA and new to C# so there is a lot to learn :) Sorry if I'm asking a stupid question.

Is it possible to rotate the text output of Nuclex Fonts?

Best regards,

ztarsson

 

Cygon's picture

Yes

You will have to use a custom effect, however.

To do this, create a new effect file (you can use the effect code stored in FontEffect.cs as a template) and have your vertex shader to do the rotation (you can make it so the effect has a parameter for the rotation angle) and assign this new effect to the BitmapFont instance before rendering.

You also might want to enable texture filtering in this special case to prevent the rotated text from looking pixelated.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <br> <a> <em> <strong> <u> <i> <b> <cite> <blockcode> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <pre> <span>
  • You can highlight code with any of the following tags: <blockcode>

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.