官术网_书友最值得收藏!

Introducing the Content Pipeline

The Flood Control Content (Content) project inside Solution Explorer is a special kind of project called a Content Project. Items in your game's content project are converted into .XNB resource files by Content Importers and Content Processors.

If you right-click on one of the image files you just added to the Flood Control project and select Properties, you will see that for both the Importer and Processor, the Content Pipeline will use Texture – XNA Framework. This means that the Importer will take the file in its native format (.PNG in this case) and convert it to a format that the processor recognizes as an image. The processor then converts the image into a .XNB file, which is a compressed binary format that XNA's content manager can read directly into a Texture2D object.

There are Content Importer/Content Processor pairs for several different types of content—images, audio, video, fonts, 3D models, and shader language effects files. All of these content types get converted to .XNB files, which can be used at runtime.

Introducing the Content Pipeline

In order to see how to use the Content Pipeline at runtime, let's go ahead and write the code to read these textures into memory when the game starts:

主站蜘蛛池模板: 西青区| 平顶山市| 麻栗坡县| 安化县| 加查县| 九龙坡区| 科技| 夏津县| 白城市| 万载县| 天镇县| 葵青区| 上高县| 前郭尔| 林芝县| 普安县| 徐闻县| 宁城县| 嘉禾县| 雷山县| 蒲城县| 西丰县| 蛟河市| 天祝| 黄平县| 西峡县| 株洲市| 池州市| 松阳县| 囊谦县| 遵义县| 政和县| 右玉县| 康乐县| 郯城县| 旅游| 丽江市| 青田县| 卫辉市| 嘉峪关市| 泗阳县|