C HA PTER 3 WORKING WITH 2D IMA GES/TEXTU RES IN XN A 2.0 in Office Word

Make Data Matrix in Office Word C HA PTER 3 WORKING WITH 2D IMA GES/TEXTU RES IN XN A 2.0

C HA PTER 3 WORKING WITH 2D IMA GES/TEXTU RES IN XN A 2.0
Data Matrix ECC200 Generation In None
Using Barcode generator for Microsoft Word Control to generate, create Data Matrix image in Office Word applications.
www.OnBarcode.com
Print UPCA In None
Using Barcode encoder for Office Word Control to generate, create Universal Product Code version A image in Office Word applications.
www.OnBarcode.com
The Content Pipeline
Print QR Code ISO/IEC18004 In None
Using Barcode creator for Microsoft Word Control to generate, create QR Code 2d barcode image in Word applications.
www.OnBarcode.com
Printing Barcode In None
Using Barcode generator for Microsoft Word Control to generate, create Barcode image in Word applications.
www.OnBarcode.com
Before you can use an image file in your XNA project, you need to load it from a file. This involves reading the bytes, selecting the useful data, and running this data through a decompressing algorithm if needed. The same is true for other art assets, such as 3D models. Their data needs to be loaded from a file, and after a lot of data manipulations, a Model object needs to be created based on this data. This whole process that starts by a file on disk and results in an object ready to be used by your XNA project is taken care of by the content pipeline of XNA. Actually, each type of art asset has its own content pipeline. As you can see in Figure 3-5, a complete content pipeline consists of an importer, a processor, a serializer, and a deserializer.
Barcode Drawer In None
Using Barcode drawer for Office Word Control to generate, create Barcode image in Office Word applications.
www.OnBarcode.com
USS Code 128 Maker In None
Using Barcode drawer for Office Word Control to generate, create Code128 image in Microsoft Word applications.
www.OnBarcode.com
Source File
Encode Code 39 In None
Using Barcode generation for Word Control to generate, create Code 3 of 9 image in Microsoft Word applications.
www.OnBarcode.com
2/5 Interleaved Creation In None
Using Barcode encoder for Office Word Control to generate, create Interleaved 2 of 5 image in Word applications.
www.OnBarcode.com
Importer C O M P I L E T I M E
Decoding DataMatrix In Visual Studio .NET
Using Barcode decoder for .NET framework Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
ECC200 Encoder In .NET Framework
Using Barcode drawer for Visual Studio .NET Control to generate, create Data Matrix ECC200 image in Visual Studio .NET applications.
www.OnBarcode.com
DOM Object
Encode Code 128 Code Set A In Java
Using Barcode creation for Android Control to generate, create USS Code 128 image in Android applications.
www.OnBarcode.com
Read Data Matrix ECC200 In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Content Processor Serializer
Paint EAN-13 Supplement 5 In Java
Using Barcode generation for Java Control to generate, create UPC - 13 image in Java applications.
www.OnBarcode.com
Barcode Creation In Java
Using Barcode maker for Android Control to generate, create Barcode image in Android applications.
www.OnBarcode.com
Game Object Model
Barcode Creation In .NET Framework
Using Barcode creator for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
UCC - 12 Maker In .NET Framework
Using Barcode creation for VS .NET Control to generate, create EAN / UCC - 13 image in .NET applications.
www.OnBarcode.com
Binary File R U N T I M E
Reading Barcode In Java
Using Barcode reader for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Denso QR Bar Code Creator In Objective-C
Using Barcode generation for iPad Control to generate, create QR Code image in iPad applications.
www.OnBarcode.com
Deserializer
Encode GTIN - 128 In Visual C#
Using Barcode generation for VS .NET Control to generate, create GS1-128 image in VS .NET applications.
www.OnBarcode.com
EAN13 Reader In Visual C#
Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
Game Object
Figure 3-5. The content pipeline flowchart At compile time (your project is compiled each time you press F5), the source file is read in from disk, its content is processed, and the result is serialized into an .xnb binary file on disk. You can find these binary files in the Content submap of the map your .exe file is in. When the game is run (after compiling, when running the game on Xbox or when doubleclicking the .exe file), this .xnb binary file is deserialized, so all the useful information becomes readily available, without any further need of processing. The obvious advantage of this approach is that all processing needs to be done only once (at compile time), instead of each time when the game is run. A second advantage is that the .xnb files are platform independent, so they can be used for both PCs and Xbox 360.
CHAPTER 3 WORKING WITH 2D IMAGES /TEXTURES IN XNA 2.0
Let s dissect the compile stage a bit more, because it is executed each time you compile your project. The compile stage is divided into three substages: The importer, which reads the source file and extracts the useful data from the file. This data is stored in a standard format specific for the kind of data. For a model, this standard format is a NodeContent object, while for an image, this is a TextureContent object. Such standard formats are called DOM objects. You can find a list of default DOM objects in Table 3-1. The processor, which actually does all the processing on the data contained in the DOM object and generates an object as it could be used in a game. In case of a Model, for example, the processor can add normal data, calculate tangents, set effects on the model, and much more. The serializer, or TypeWriter, defines how the .xnb binary file needs to be generated from the output of the processor. This approach has an additional advantage in that if you want to change something in the compile stage, you probably have to change only one of the three substages. For example, if you have created a Model in a format that is not natively supported by the XNA Framework, all you have to do is write a new importer, which reads your file and creates a NodeContent object from the data contained in it. You can leave the rest of the work to the default content pipeline components, because the default processor for the NodeContent will take your object from there. During runtime, there s only one small stage that needs to be executed: The deserializer, or TypeReader, defines how the game object can again be constructed from the binary data stream stored in the .xnb file. Because no processing calculations need to be done here, this really takes almost no time in comparison to what is being done at compile time. XNA comes with a lot of default content importers and content processors. Combining TextureImporter and TextureProcessor, you can import almost any image format into your XNA project. Combining the XImporter or FbxImporter with ModelImporter, you can import .x or .fbx models on disk into your XNA project.
Copyright © OnBarcode.com . All rights reserved.