Export (0) Print
Expand All

Accessing Custom Item Templates

Describes how to access custom item templates. Visual Studio item templates represent items that a user can add to a project using the Add New Item dialog box. With a few modifications to the item template, you can make custom items represented by item templates available to XNA Game Studio projects.

Bb203936.note(en-us,XNAGameStudio.31).gifNote
You can find detailed documentation of Visual Studio item templates in the Visual Studio 2008 documentation set Creating Item Templates.

Item templates contain a .vstemplate file that provides an XML description of the template. For Xbox 360 and Zune projects, XNA Game Studio filters the item template list based on the contents of this file. To make an item template properly compatible with XNA Game Studio projects, add the TemplateGroupID element to the .vstemplate file.

Values for the TemplateGroupID depend on the targeted XNA Framework:

  • For XNA Framework 3.0: TemplateGroupID can be "XnaFramework-v2," "XnaFramework-v2-Xbox360," "XnaFramework-v2-Zune," "XnaFramework-v2-Devices," and "XnaFramework-v2-Windows."
  • For XNA Framework 3.1: TemplateGroupID can be "XnaFramework-v3.1," "XnaFramework-v3.1-Xbox360," "XnaFramework-v3.1-Zune," "XnaFramework-v3.1-Devices," and "XnaFramework-v3.1-Windows."
Bb203936.note(en-us,XNAGameStudio.31).gifNote
For Windows projects, the ShowByDefault element will have a value of "false."

The following XML example defines the TemplateGroupID element in the .vstemplate file of an Xbox 360 game-specific item template.

 ... <TemplateData>
         <Name>MyX360Class</Name>
         <Description>My custom Xbox 360 C# class.</Description>
         <ProjectType>CSharp</ProjectType>
         <TemplateGroupID>XnaFramework-v3.1-Xbox360</TemplateGroupID>
         <ShowByDefault>false</ShowByDefault> ... </TemplateData> ...
      

Community Additions

ADD
Show:
© 2014 Microsoft