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.

Note

You can find detailed documentation for 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. 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.

The possible values of TemplateGroupID may be:

Value Description
XnaFramework-v4.0 A general-purpose item template for an XNA Game Studio project.
XnaFramework-v4.0-Content An item to add to the Content Pipeline package. Added when you right-click Add in an XNA Game Studio content project.
XnaFramework-v4.0-Devices Specialized classes, new interfaces, or an item included at the code level for compilation. Added when you right-click Add in an XNA Game Studio code project.

Note

For Windows projects, the ShowByDefault element will have a value of "false."

Example

The following XML example defines the TemplateGroupID element in the .vstemplate file of an XNA Game Studio game-specific item template.

 ... <TemplateData>
         <Name>MyClass</Name>
         <Description>My custom XNA Game Studio class.</Description>
         <ProjectType>CSharp</ProjectType>
         <TemplateGroupID>XnaFramework-v40</TemplateGroupID>
         <ShowByDefault>false</ShowByDefault> ... </TemplateData> ...
      

See Also

Extending Game Studio
Advanced Topics
Getting Started with XNA Game Studio Development