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

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:

主站蜘蛛池模板: 南宁市| 饶平县| 丰县| 光泽县| 东乡县| 镇坪县| 吉水县| 苗栗县| 衡阳县| 双鸭山市| 略阳县| 含山县| 正宁县| 镶黄旗| 新野县| 拜泉县| 靖江市| 商城县| 东乡族自治县| 牙克石市| 临沂市| 西峡县| 咸宁市| 定安县| 始兴县| 利津县| 金华市| 禄劝| 精河县| 彰化市| 仁寿县| 固安县| 鹿泉市| 洛南县| 济源市| 镇安县| 洪湖市| 阿荣旗| 永德县| 南陵县| 大余县|