Most of the time, the standard content importers and processors are enough for Windows Phone Game Development. However, sometimes you need to process a different type of file that the XNA framework does not support. At present, you will need, a custom importer and processor. In this recipe, you will learn how to write your own importer and processor for text in Windows Phone 7 XNA.
In order to read the specific game asset, first you should develop a corresponding importer and processor. Then, write the processed data to an XNB file with the override Write()
method of ContentTypeWriter
class in the content pipeline project. After that, override the Read()
method of ContentTypeWriter
class in a separate class in the main game project. In this example, you will write a text importer and read the data from the compiled text in an XNB file into your game.