BitmapFont on Content-Pipeline

An old XNA Extras had used System.XML, but it becomes unable to use because XNA Framework doesn’t allow to reference System.XML. But, we can use great solution using Content-Pipeline. I found it in this thread.

In this thread, new XNAExtras Aaron Leiby have posted is a very good solution. This may be the quickest bitmap font solution I have seen. This converted XNAExtras makes it possible to load XML files generated by bmfontgen with content-pipeline.

  1. Build XNABaseWin or Xbox.
  2. Modify the reference of XNAImport and build it.
  3. Double-click the property of your game project and add XNAImport.dll to your content-pipeline.
  4. Add XNABase.dll as the reference of your project.
  5. Change properties of your XML files generated by bmfontgen. XNA Content Pipeline is true, Content Importer is BitmapFontImporter, Content Font Processor is BitmapFontProcessor.

Now, you can load your bitmap font as the following:

BitmapFont bitmapFont = content.Load(asset_name);

Advertisements
This entry was posted in XNA. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s