Skip to content

danzel/IronXna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A SpriteFont style Bordered Font renderer for Xna.

Usage:

Add a reference to IronXna in your code project and a reference to IronXna.Design in your content projects.
In your content project, add a new SpriteFont.
Edit the Spritefont and add the following:

    <!--
    Thickness of the border to generate. In Pixels
    -->
    <BorderThickness>12</BorderThickness>
    <!--
    Whether to include a double sized font for use with retina devices. If included and a (iOS) retina device is detected we will draw at the same size but with a higher quality texture
    -->
    <IncludeRetina>false</IncludeRetina>

Optionally add:
	<!--
	SpacingMultiplier is a float value, the measured width of a space is multiplied by this.
	Use it if there isn't enough space between words.
	-->
	<SpaceMultiplier>1.3</SpaceMultiplier>


Choose the spritefont in the solution explorer and change the "Content Importer" and "Content Processor" to "Bordered Font Importer" / "Bordered Text Processor" (TODO: Rename these to be the same)

Now load it with:
_timesNewRomanBordered = Content.Load<BorderedFont>("TimesNewRomanBordered");

And draw with the extension methods from SpriteBatchBorderedFontExtensions:
_spriteBatch.DrawString(_timesNewRomanBordered, "Hi", new Vector2(100, 450), Color.Black, Color.White);


License: Do whatever you want with this code :)

About

Extensions for XNA - Bordered Sprite Font!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages